diff --git a/pkg/feature/conditions.go b/pkg/feature/conditions.go index 9a9373ba130..7b27196dd1a 100644 --- a/pkg/feature/conditions.go +++ b/pkg/feature/conditions.go @@ -64,6 +64,7 @@ func WaitForPodsToBeReady(namespace string) Action { return false, err } + podList.Items = filterEvictedPods(podList.Items) readyPods := 0 totalPods := len(podList.Items) @@ -102,6 +103,18 @@ func WaitForPodsToBeReady(namespace string) Action { } } +func filterEvictedPods(pods []corev1.Pod) []corev1.Pod { + var filteredPods []corev1.Pod + + for _, pod := range pods { + if pod.Status.Phase != corev1.PodFailed || pod.Status.Reason != "Evicted" { + filteredPods = append(filteredPods, pod) + } + } + + return filteredPods +} + func WaitForResourceToBeCreated(namespace string, gvk schema.GroupVersionKind) Action { return func(ctx context.Context, cli client.Client, f *Feature) error { f.Log.Info("waiting for resource to be created", "namespace", namespace, "resource", gvk)