From 3b109385fbbcc5303426bb14ec05d67421c5b14c Mon Sep 17 00:00:00 2001 From: Camila Macedo <7708031+camilamacedo86@users.noreply.github.com> Date: Tue, 7 Oct 2025 05:32:21 -0300 Subject: [PATCH] UPSTREAM: : for incompatible test add func to wait builder and deployer SA creation by OCP controller --- openshift/tests-extension/pkg/helpers/cluster_extension.go | 2 +- openshift/tests-extension/test/olmv1-incompatible.go | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/openshift/tests-extension/pkg/helpers/cluster_extension.go b/openshift/tests-extension/pkg/helpers/cluster_extension.go index 63603d5e4..db27ee1fc 100644 --- a/openshift/tests-extension/pkg/helpers/cluster_extension.go +++ b/openshift/tests-extension/pkg/helpers/cluster_extension.go @@ -214,7 +214,7 @@ func ExpectServiceAccountExists(ctx context.Context, name, namespace string) { Eventually(func(g Gomega) { err := k8sClient.Get(ctx, client.ObjectKey{Name: name, Namespace: namespace}, sa) g.Expect(err).ToNot(HaveOccurred(), fmt.Sprintf("failed to get ServiceAccount %q/%q: %v", namespace, name, err)) - }).WithTimeout(10*time.Second).WithPolling(1*time.Second).Should(Succeed(), "ServiceAccount %q/%q did not become visible within timeout", namespace, name) + }).WithTimeout(5*time.Minute).WithPolling(3*time.Second).Should(Succeed(), "ServiceAccount %q/%q did not become visible within timeout", namespace, name) } // ExpectClusterRoleBindingExists waits for a ClusterRoleBinding to be available and visible to the client. diff --git a/openshift/tests-extension/test/olmv1-incompatible.go b/openshift/tests-extension/test/olmv1-incompatible.go index f5572003d..921e1b1fd 100644 --- a/openshift/tests-extension/test/olmv1-incompatible.go +++ b/openshift/tests-extension/test/olmv1-incompatible.go @@ -79,6 +79,13 @@ var _ = Describe("[sig-olmv1][OCPFeatureGate:NewOLM] OLMv1 operator installation nsCleanup := createNamespace(nsName) DeferCleanup(nsCleanup) + // The builder (and deployer) service accounts are created by OpenShift itself which injects them in the NS. + By(fmt.Sprintf("waiting for builder serviceaccount in %s", nsName)) + helpers.ExpectServiceAccountExists(ctx, "builder", nsName) + + By(fmt.Sprintf("waiting for deployer serviceaccount in %s", nsName)) + helpers.ExpectServiceAccountExists(ctx, "deployer", nsName) + By("applying image-puller RoleBinding") rbCleanup := createImagePullerRoleBinding(rbName, nsName) DeferCleanup(rbCleanup)