Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions test/e2e/thv-operator/virtualmcp/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,11 +181,26 @@ func WaitForPodsReady(ctx context.Context, c client.Client, namespace string, la
return fmt.Errorf("pod %s is in phase %s", pod.Name, pod.Status.Phase)
}

containerReady := false
podReady := false

for _, condition := range pod.Status.Conditions {
if condition.Type == corev1.ContainersReady && condition.Status != corev1.ConditionTrue {
return fmt.Errorf("pod %s containers not ready", pod.Name)
if condition.Type == corev1.ContainersReady {
containerReady = condition.Status == corev1.ConditionTrue
}

if condition.Type == corev1.PodReady {
podReady = condition.Status == corev1.ConditionTrue
}
}

if !containerReady {
return fmt.Errorf("pod %s containers not ready", pod.Name)
}

if !podReady {
return fmt.Errorf("pod %s not ready", pod.Name)
}
}
return nil
}, timeout, 5*time.Second).Should(gomega.Succeed())
Expand Down
Loading