Merge pull request #3281 from lixingchenDaoCloud/lxcDsp

remove bootstrapKubeConfigFile error not check
This commit is contained in:
karmada-bot 2023-03-22 17:34:25 +08:00 committed by GitHub
commit 70d07cfad9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -318,7 +318,12 @@ func (o *CommandRegisterOption) Run(parentCommand string) error {
bootstrapKubeConfigFile := filepath.Join(KarmadaDir, KarmadaAgentBootstrapKubeConfigFileName)
// Deletes the bootstrapKubeConfigFile, so the credential used for TLS bootstrap is removed from disk
defer os.Remove(bootstrapKubeConfigFile)
defer func(name string) {
err := os.Remove(name)
if err != nil {
klog.Warningf("Failed to remove bootstrapKubeConfigFile: %v", err)
}
}(bootstrapKubeConfigFile)
// fetch the bootstrap client to connect to karmada apiserver temporarily
fmt.Println("[karmada-agent-start] Waiting to perform the TLS Bootstrap")