diff --git a/scripts/src/hwlab-node/control-actions.ts b/scripts/src/hwlab-node/control-actions.ts index 6c11e90f..c1fa2ab2 100644 --- a/scripts/src/hwlab-node/control-actions.ts +++ b/scripts/src/hwlab-node/control-actions.ts @@ -503,8 +503,12 @@ export function nodeRuntimeSync(scoped: ReturnType/dev/null || true)", " failed=$(kubectl -n \"$runtime_namespace\" get \"$job\" -o go-template='{{ range .status.conditions }}{{ if or (eq .type \"Failed\") (eq .type \"FailureTarget\") }}{{ .status }} {{ end }}{{ end }}' 2>/dev/null || true)", " case \"$tracking\" in \"$app:\"*) ;; *) continue ;; esac", - " case \"$failed\" in *True*) ;; *) continue ;; esac", " hook_name=${job#job.batch/}", + " waiting=$(kubectl -n \"$runtime_namespace\" get pod -l \"job-name=$hook_name\" -o 'jsonpath={range .items[*].status.containerStatuses[*]}{.state.waiting.reason}{\" \"}{end}' 2>/dev/null || true)", + " case \"$failed\" in", + " *True*) ;;", + " *) case \"$waiting\" in *ImagePullBackOff*|*ErrImagePull*|*CrashLoopBackOff*) ;; *) continue ;; esac ;;", + " esac", " failed_hook_count=$((failed_hook_count + 1))", " if [ -z \"$failed_hooks\" ]; then failed_hooks=$hook_name; else failed_hooks=$failed_hooks,$hook_name; fi", " if [ \"$dry_run\" = false ]; then",