From e2ffd2be698e778ea41ac788024e9e5ba486e92f Mon Sep 17 00:00:00 2001 From: Kyle Squizzato Date: Fri, 11 Oct 2024 10:18:56 -0700 Subject: [PATCH] Iterate over deployList objects Signed-off-by: Kyle Squizzato --- test/e2e/e2e_suite_test.go | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/test/e2e/e2e_suite_test.go b/test/e2e/e2e_suite_test.go index 8f0c1ee3f..3c61a50bf 100644 --- a/test/e2e/e2e_suite_test.go +++ b/test/e2e/e2e_suite_test.go @@ -123,19 +123,19 @@ func validateController(kc *kubeclient.KubeClient, labelSelector string, name st return fmt.Errorf("expected at least %d %s controller deployments, got %d", controllerItems, name, len(deployList.Items)) } - deployment := deployList.Items[0] - - // Ensure the deployment is not being deleted. - if deployment.DeletionTimestamp != nil { - return fmt.Errorf("controller pod: %s deletion timestamp should be nil, got: %v", - deployment.Name, deployment.DeletionTimestamp) - } - // Ensure the deployment is running and has the expected name. - if !strings.Contains(deployment.Name, "controller-manager") { - return fmt.Errorf("controller deployment name %s does not contain 'controller-manager'", deployment.Name) - } - if deployment.Status.ReadyReplicas < 1 { - return fmt.Errorf("controller deployment: %s does not yet have any ReadyReplicas", deployment.Name) + for _, deployment := range deployList.Items { + // Ensure the deployment is not being deleted. + if deployment.DeletionTimestamp != nil { + return fmt.Errorf("controller pod: %s deletion timestamp should be nil, got: %v", + deployment.Name, deployment.DeletionTimestamp) + } + // Ensure the deployment is running and has the expected name. + if !strings.Contains(deployment.Name, "controller-manager") { + return fmt.Errorf("controller deployment name %s does not contain 'controller-manager'", deployment.Name) + } + if deployment.Status.ReadyReplicas < 1 { + return fmt.Errorf("controller deployment: %s does not yet have any ReadyReplicas", deployment.Name) + } } return nil