[ Agent ] [ APP ] - refresh app procedure

This commit is contained in:
zeaslity
2023-11-20 11:29:16 +08:00
parent f1b8f8efc8
commit 72269894db
7 changed files with 236 additions and 44 deletions

View File

@@ -10,14 +10,14 @@ func CheckPodStatus(specific string, supreme string) bool {
log.Error("kubectl命令不存在无法查看Pod状态请查看")
}
executor, err := SingleLineCommandExecutor([]string{
ok, resultLog := AllCommandExecutor([]string{
"kubectl", "-n", supreme, "get", "pod", specific, "-o", "jsonpath='{.status.phase}'",
})
if err != nil {
if !ok {
return false
}
for _, resultLine := range executor {
for _, resultLine := range resultLog {
if strings.HasPrefix(resultLine, "Running") {
return true
}