Skip to content

Commit 63a721e

Browse files
authored
fix(cli): ignore finished pods in readiness check (#2529)
1 parent 6bb9022 commit 63a721e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

cli/pkg/utils/pod.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,13 @@ func AssertPodReady(pod *corev1.Pod) error {
1111
return fmt.Errorf("pod is nil")
1212
}
1313

14+
// simply ignore finished pod
15+
// it can be seen as just an execution record, not a running pod
16+
// and the deployment will create a new replica
17+
if pod.Status.Phase == corev1.PodSucceeded || pod.Status.Phase == corev1.PodFailed {
18+
return nil
19+
}
20+
1421
podKey := fmt.Sprintf("%s/%s", pod.Namespace, pod.Name)
1522
if pod.DeletionTimestamp != nil {
1623
return fmt.Errorf("pod %s is terminating", podKey)

0 commit comments

Comments
 (0)