Skip to content

Commit 7a056b2

Browse files
e2e: fixup custom configmaps with labels
Signed-off-by: Steve Kuznetsov <[email protected]>
1 parent 8a68d79 commit 7a056b2

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

test/e2e/subscription_e2e_test.go

+14
Original file line numberDiff line numberDiff line change
@@ -159,13 +159,21 @@ var _ = Describe("Subscription", func() {
159159
It("creation if not installed", func() {
160160

161161
defer func() {
162+
if env := os.Getenv("SKIP_CLEANUP"); env != "" {
163+
fmt.Printf("Skipping cleanup of subscriptions in namespace %s\n", generatedNamespace.GetName())
164+
return
165+
}
162166
require.NoError(GinkgoT(), crc.OperatorsV1alpha1().Subscriptions(generatedNamespace.GetName()).DeleteCollection(context.Background(), metav1.DeleteOptions{}, metav1.ListOptions{}))
163167
}()
168+
169+
By("creating a catalog")
164170
require.NoError(GinkgoT(), initCatalog(GinkgoT(), generatedNamespace.GetName(), c, crc))
165171

172+
By(fmt.Sprintf("creating a subscription: %s/%s", generatedNamespace.GetName(), testSubscriptionName))
166173
cleanup, _ := createSubscription(GinkgoT(), crc, generatedNamespace.GetName(), testSubscriptionName, testPackageName, betaChannel, operatorsv1alpha1.ApprovalAutomatic)
167174
defer cleanup()
168175

176+
By("waiting for the subscription to have a current CSV and be at latest")
169177
var currentCSV string
170178
Eventually(func() bool {
171179
fetched, err := crc.OperatorsV1alpha1().Subscriptions(generatedNamespace.GetName()).Get(context.Background(), testSubscriptionName, metav1.GetOptions{})
@@ -3073,6 +3081,9 @@ var (
30733081
dummyCatalogConfigMap = &corev1.ConfigMap{
30743082
ObjectMeta: metav1.ObjectMeta{
30753083
Name: catalogConfigMapName,
3084+
Labels: map[string]string{
3085+
install.OLMManagedLabelKey: install.OLMManagedLabelValue,
3086+
},
30763087
},
30773088
Data: map[string]string{},
30783089
}
@@ -3121,6 +3132,7 @@ func initCatalog(t GinkgoTInterface, namespace string, c operatorclient.ClientIn
31213132
}
31223133
return err
31233134
}
3135+
t.Logf("created configmap %s/%s", dummyCatalogConfigMap.Namespace, dummyCatalogConfigMap.Name)
31243136

31253137
dummyCatalogSource.SetNamespace(namespace)
31263138
if _, err := crc.OperatorsV1alpha1().CatalogSources(namespace).Create(context.Background(), &dummyCatalogSource, metav1.CreateOptions{}); err != nil {
@@ -3129,6 +3141,7 @@ func initCatalog(t GinkgoTInterface, namespace string, c operatorclient.ClientIn
31293141
}
31303142
return err
31313143
}
3144+
t.Logf("created catalog source %s/%s", dummyCatalogSource.Namespace, dummyCatalogSource.Name)
31323145

31333146
fetched, err := fetchCatalogSourceOnStatus(crc, dummyCatalogSource.GetName(), dummyCatalogSource.GetNamespace(), catalogSourceRegistryPodSynced())
31343147
require.NoError(t, err)
@@ -3312,6 +3325,7 @@ func createSubscription(t GinkgoTInterface, crc versioned.Interface, namespace,
33123325

33133326
subscription, err := crc.OperatorsV1alpha1().Subscriptions(namespace).Create(context.Background(), subscription, metav1.CreateOptions{})
33143327
Expect(err).ToNot(HaveOccurred())
3328+
t.Logf("created subscription %s/%s", subscription.Namespace, subscription.Name)
33153329
return buildSubscriptionCleanupFunc(crc, subscription), subscription
33163330
}
33173331

test/e2e/util.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -1073,11 +1073,13 @@ func SetupGeneratedTestNamespaceWithOperatorGroup(name string, og operatorsv1.Op
10731073
return ctx.Ctx().E2EClient().Create(context.Background(), &ns)
10741074
}).Should(Succeed())
10751075

1076+
ctx.Ctx().Logf("created the %s testing namespace", ns.GetName())
1077+
10761078
Eventually(func() error {
10771079
return ctx.Ctx().E2EClient().Create(context.Background(), &og)
10781080
}).Should(Succeed())
10791081

1080-
ctx.Ctx().Logf("created the %s testing namespace", ns.GetName())
1082+
ctx.Ctx().Logf("created the %s/%s operator group", og.Namespace, og.Name)
10811083

10821084
return ns
10831085
}

0 commit comments

Comments
 (0)