Skip to content

Commit 3103137

Browse files
committed
wip
1 parent 3e1dc5c commit 3103137

File tree

4 files changed

+13
-14
lines changed

4 files changed

+13
-14
lines changed

staging/operator-lifecycle-manager/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,11 @@ TEST := $(shell go run ./test/e2e/split/... -chunks $(E2E_TEST_NUM_CHUNKS) -prin
134134
endif
135135
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
136136
E2E_INSTALL_NS ?= operator-lifecycle-manager
137+
E2E_CATALOG_NS ?= $(E2E_INSTALL_NS)
137138
E2E_TEST_NS ?= operators
138139

139140
e2e:
140-
$(GINKGO) $(E2E_OPTS) $(or $(run), ./test/e2e) $< -- -namespace=$(E2E_TEST_NS) -olmNamespace=$(E2E_INSTALL_NS) -dummyImage=bitnami/nginx:latest $(or $(extra_args), -kubeconfig=${KUBECONFIG})
141+
$(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})
141142

142143
# See workflows/e2e-tests.yml See test/e2e/README.md for details.
143144
.PHONY: e2e-local

staging/operator-lifecycle-manager/test/e2e/catalog_e2e_test.go

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -131,17 +131,6 @@ var _ = Describe("Starting CatalogSource e2e tests", func() {
131131
})
132132

133133
It("global update triggers subscription sync", func() {
134-
globalNS := operatorNamespace
135-
136-
// Determine which namespace is global. Should be `openshift-marketplace` for OCP 4.2+.
137-
// Locally it is `olm`
138-
namespaces, _ := c.KubernetesInterface().CoreV1().Namespaces().List(context.Background(), metav1.ListOptions{})
139-
for _, ns := range namespaces.Items {
140-
if ns.GetName() == "openshift-marketplace" {
141-
globalNS = "openshift-marketplace"
142-
}
143-
}
144-
145134
mainPackageName := genName("nginx-")
146135

147136
mainPackageStable := fmt.Sprintf("%s-stable", mainPackageName)
@@ -179,7 +168,7 @@ var _ = Describe("Starting CatalogSource e2e tests", func() {
179168
}
180169

181170
// Create the initial catalog source
182-
cs, cleanup := createInternalCatalogSource(c, crc, mainCatalogName, globalNS, mainManifests, []apiextensions.CustomResourceDefinition{mainCRD}, []v1alpha1.ClusterServiceVersion{mainCSV})
171+
cs, cleanup := createInternalCatalogSource(c, crc, mainCatalogName, globalCatalogNamespace, mainManifests, []apiextensions.CustomResourceDefinition{mainCRD}, []v1alpha1.ClusterServiceVersion{mainCSV})
183172
defer cleanup()
184173

185174
// Attempt to get the catalog source before creating install plan

staging/operator-lifecycle-manager/test/e2e/catalog_exclusion_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ var _ = Describe("Global Catalog Exclusion", func() {
4949
globalCatalog := &v1alpha1.CatalogSource{
5050
ObjectMeta: metav1.ObjectMeta{
5151
Name: genName("bad-global-catalog-"),
52-
Namespace: operatorNamespace,
52+
Namespace: globalCatalogNamespace,
5353
},
5454
Spec: v1alpha1.CatalogSourceSpec{
5555
DisplayName: "Broken Global Catalog Source",

staging/operator-lifecycle-manager/test/e2e/e2e_test.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package e2e
33
import (
44
"context"
55
"flag"
6+
"fmt"
67
"os"
78
"testing"
89
"time"
@@ -26,6 +27,9 @@ var (
2627
olmNamespace = flag.String(
2728
"olmNamespace", "", "namespace where olm is running")
2829

30+
catalogNamespace = flag.String(
31+
"catalogNamespace", "", "namespace where the catalog-operator will run and install catalog resources")
32+
2933
communityOperators = flag.String(
3034
"communityOperators",
3135
"quay.io/operator-framework/upstream-community-operators@sha256:098457dc5e0b6ca9599bd0e7a67809f8eca397907ca4d93597380511db478fec",
@@ -54,6 +58,7 @@ var (
5458
testNamespace = ""
5559
operatorNamespace = ""
5660
communityOperatorsImage = ""
61+
globalCatalogNamespace = ""
5762
junitDir = "junit"
5863
)
5964

@@ -82,6 +87,10 @@ var _ = BeforeSuite(func() {
8287
testNamespace = *namespace
8388
operatorNamespace = *olmNamespace
8489
communityOperatorsImage = *communityOperators
90+
globalCatalogNamespace = *catalogNamespace
91+
92+
fmt.Println("catalog namespace", globalCatalogNamespace)
93+
8594
testdataDir = *testdataPath
8695
deprovision = ctx.MustProvision(ctx.Ctx())
8796
ctx.MustInstall(ctx.Ctx())

0 commit comments

Comments
 (0)