[Agent][Deploy] - fix deploy bugs

This commit is contained in:
zeaslity
2024-07-17 10:10:31 +08:00
parent 408bb9b83f
commit 63dd87b7e5
13 changed files with 15926 additions and 13012 deletions

View File

@@ -115,11 +115,15 @@ func ApplyByKubectl(applyFilePath string, cmiiEnv string) bool {
cmd.Env = append(os.Environ(), fmt.Sprintf("KUBECONFIG=%s", kubeconfig))
output, err := cmd.CombinedOutput()
if err != nil {
log.ErrorF("failed to apply resources in file %s: %v \n %s", applyFilePath, err, output)
fmt.Println("failed apply file => " + applyFilePath)
fmt.Println(string(output))
fmt.Println()
return false
}
log.InfoF("successfully apply resources in file %s\n%s", applyFilePath, output)
fmt.Println("success apply file => " + applyFilePath)
fmt.Println(string(output))
fmt.Println()
return true
}