diff --git a/Makefile b/Makefile index 98632a27fb..007c1c6680 100644 --- a/Makefile +++ b/Makefile @@ -134,10 +134,11 @@ TEST := $(shell go run ./test/e2e/split/... -chunks $(E2E_TEST_NUM_CHUNKS) -prin endif E2E_OPTS ?= $(if $(E2E_SEED),-seed '$(E2E_SEED)') $(if $(SKIP), -skip '$(SKIP)') $(if $(TEST),-focus '$(TEST)') $(if $(ARTIFACT_DIR), -output-dir $(ARTIFACT_DIR) -junit-report junit_e2e.xml) -flake-attempts $(E2E_FLAKE_ATTEMPTS) -nodes $(E2E_NODES) -timeout $(E2E_TIMEOUT) -v -randomize-suites -race -trace -progress E2E_INSTALL_NS ?= operator-lifecycle-manager +E2E_CATALOG_NS ?= $(E2E_INSTALL_NS) E2E_TEST_NS ?= operators e2e: - $(GINKGO) $(E2E_OPTS) $(or $(run), ./test/e2e) $< -- -namespace=$(E2E_TEST_NS) -olmNamespace=$(E2E_INSTALL_NS) -dummyImage=bitnami/nginx:latest $(or $(extra_args), -kubeconfig=${KUBECONFIG}) + $(GINKGO) $(E2E_OPTS) $(or $(run), ./test/e2e) $< -- -namespace=$(E2E_TEST_NS) -olmNamespace=$(E2E_INSTALL_NS) -catalogNamespace=$(E2E_CATALOG_NS) -dummyImage=bitnami/nginx:latest $(or $(extra_args), -kubeconfig=${KUBECONFIG}) # See workflows/e2e-tests.yml See test/e2e/README.md for details. .PHONY: e2e-local diff --git a/test/e2e/catalog_e2e_test.go b/test/e2e/catalog_e2e_test.go index fde062c663..e02436d375 100644 --- a/test/e2e/catalog_e2e_test.go +++ b/test/e2e/catalog_e2e_test.go @@ -131,17 +131,6 @@ var _ = Describe("Starting CatalogSource e2e tests", func() { }) It("global update triggers subscription sync", func() { - globalNS := operatorNamespace - - // Determine which namespace is global. Should be `openshift-marketplace` for OCP 4.2+. - // Locally it is `olm` - namespaces, _ := c.KubernetesInterface().CoreV1().Namespaces().List(context.Background(), metav1.ListOptions{}) - for _, ns := range namespaces.Items { - if ns.GetName() == "openshift-marketplace" { - globalNS = "openshift-marketplace" - } - } - mainPackageName := genName("nginx-") mainPackageStable := fmt.Sprintf("%s-stable", mainPackageName) @@ -179,7 +168,7 @@ var _ = Describe("Starting CatalogSource e2e tests", func() { } // Create the initial catalog source - cs, cleanup := createInternalCatalogSource(c, crc, mainCatalogName, globalNS, mainManifests, []apiextensions.CustomResourceDefinition{mainCRD}, []v1alpha1.ClusterServiceVersion{mainCSV}) + cs, cleanup := createInternalCatalogSource(c, crc, mainCatalogName, globalCatalogNamespace, mainManifests, []apiextensions.CustomResourceDefinition{mainCRD}, []v1alpha1.ClusterServiceVersion{mainCSV}) defer cleanup() // Attempt to get the catalog source before creating install plan diff --git a/test/e2e/catalog_exclusion_test.go b/test/e2e/catalog_exclusion_test.go index 8d0bb1b408..5f2d04556b 100644 --- a/test/e2e/catalog_exclusion_test.go +++ b/test/e2e/catalog_exclusion_test.go @@ -48,7 +48,7 @@ var _ = Describe("Global Catalog Exclusion", func() { globalCatalog := &v1alpha1.CatalogSource{ ObjectMeta: metav1.ObjectMeta{ Name: genName("bad-global-catalog-"), - Namespace: operatorNamespace, + Namespace: globalCatalogNamespace, }, Spec: v1alpha1.CatalogSourceSpec{ DisplayName: "Broken Global Catalog Source", diff --git a/test/e2e/e2e_test.go b/test/e2e/e2e_test.go index 55d8487ff3..534089165f 100644 --- a/test/e2e/e2e_test.go +++ b/test/e2e/e2e_test.go @@ -26,6 +26,9 @@ var ( olmNamespace = flag.String( "olmNamespace", "", "namespace where olm is running") + catalogNamespace = flag.String( + "catalogNamespace", "", "namespace where the global catalog content is stored") + communityOperators = flag.String( "communityOperators", "quay.io/operator-framework/upstream-community-operators@sha256:098457dc5e0b6ca9599bd0e7a67809f8eca397907ca4d93597380511db478fec", @@ -54,6 +57,7 @@ var ( testNamespace = "" operatorNamespace = "" communityOperatorsImage = "" + globalCatalogNamespace = "" junitDir = "junit" ) @@ -82,6 +86,7 @@ var _ = BeforeSuite(func() { testNamespace = *namespace operatorNamespace = *olmNamespace communityOperatorsImage = *communityOperators + globalCatalogNamespace = *catalogNamespace testdataDir = *testdataPath deprovision = ctx.MustProvision(ctx.Ctx()) ctx.MustInstall(ctx.Ctx())