@@ -159,13 +159,21 @@ var _ = Describe("Subscription", func() {
159
159
It ("creation if not installed" , func () {
160
160
161
161
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
+ }
162
166
require .NoError (GinkgoT (), crc .OperatorsV1alpha1 ().Subscriptions (generatedNamespace .GetName ()).DeleteCollection (context .Background (), metav1.DeleteOptions {}, metav1.ListOptions {}))
163
167
}()
168
+
169
+ By ("creating a catalog" )
164
170
require .NoError (GinkgoT (), initCatalog (GinkgoT (), generatedNamespace .GetName (), c , crc ))
165
171
172
+ By (fmt .Sprintf ("creating a subscription: %s/%s" , generatedNamespace .GetName (), testSubscriptionName ))
166
173
cleanup , _ := createSubscription (GinkgoT (), crc , generatedNamespace .GetName (), testSubscriptionName , testPackageName , betaChannel , operatorsv1alpha1 .ApprovalAutomatic )
167
174
defer cleanup ()
168
175
176
+ By ("waiting for the subscription to have a current CSV and be at latest" )
169
177
var currentCSV string
170
178
Eventually (func () bool {
171
179
fetched , err := crc .OperatorsV1alpha1 ().Subscriptions (generatedNamespace .GetName ()).Get (context .Background (), testSubscriptionName , metav1.GetOptions {})
@@ -3073,6 +3081,9 @@ var (
3073
3081
dummyCatalogConfigMap = & corev1.ConfigMap {
3074
3082
ObjectMeta : metav1.ObjectMeta {
3075
3083
Name : catalogConfigMapName ,
3084
+ Labels : map [string ]string {
3085
+ install .OLMManagedLabelKey : install .OLMManagedLabelValue ,
3086
+ },
3076
3087
},
3077
3088
Data : map [string ]string {},
3078
3089
}
@@ -3121,6 +3132,7 @@ func initCatalog(t GinkgoTInterface, namespace string, c operatorclient.ClientIn
3121
3132
}
3122
3133
return err
3123
3134
}
3135
+ t .Logf ("created configmap %s/%s" , dummyCatalogConfigMap .Namespace , dummyCatalogConfigMap .Name )
3124
3136
3125
3137
dummyCatalogSource .SetNamespace (namespace )
3126
3138
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
3129
3141
}
3130
3142
return err
3131
3143
}
3144
+ t .Logf ("created catalog source %s/%s" , dummyCatalogSource .Namespace , dummyCatalogSource .Name )
3132
3145
3133
3146
fetched , err := fetchCatalogSourceOnStatus (crc , dummyCatalogSource .GetName (), dummyCatalogSource .GetNamespace (), catalogSourceRegistryPodSynced ())
3134
3147
require .NoError (t , err )
@@ -3312,6 +3325,7 @@ func createSubscription(t GinkgoTInterface, crc versioned.Interface, namespace,
3312
3325
3313
3326
subscription , err := crc .OperatorsV1alpha1 ().Subscriptions (namespace ).Create (context .Background (), subscription , metav1.CreateOptions {})
3314
3327
Expect (err ).ToNot (HaveOccurred ())
3328
+ t .Logf ("created subscription %s/%s" , subscription .Namespace , subscription .Name )
3315
3329
return buildSubscriptionCleanupFunc (crc , subscription ), subscription
3316
3330
}
3317
3331
0 commit comments