@@ -19,6 +19,7 @@ import (
19
19
"k8s.io/apimachinery/pkg/api/meta"
20
20
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
21
21
"k8s.io/apimachinery/pkg/labels"
22
+ "k8s.io/apimachinery/pkg/types"
22
23
23
24
"github.com/operator-framework/api/pkg/lib/version"
24
25
"github.com/operator-framework/api/pkg/operators/v1alpha1"
@@ -255,10 +256,6 @@ var _ = Describe("Catalog represents a store of bundles which OLM can use to ins
255
256
// Update catalog configmap
256
257
updateInternalCatalog (GinkgoT (), c , crc , mainCatalogName , testNamespace , []apiextensions.CustomResourceDefinition {dependentCRD }, []v1alpha1.ClusterServiceVersion {mainCSV , dependentCSV }, append (mainManifests , dependentManifests ... ))
257
258
258
- // Get updated configmap
259
- updatedConfigMap , err := c .KubernetesInterface ().CoreV1 ().ConfigMaps (testNamespace ).Get (context .Background (), fetchedInitialCatalog .Spec .ConfigMap , metav1.GetOptions {})
260
- Expect (err ).ShouldNot (HaveOccurred ())
261
-
262
259
fetchedUpdatedCatalog , err := fetchCatalogSourceOnStatus (crc , mainCatalogName , testNamespace , func (catalog * v1alpha1.CatalogSource ) bool {
263
260
before := fetchedInitialCatalog .Status .ConfigMapResource
264
261
after := catalog .Status .ConfigMapResource
@@ -272,6 +269,20 @@ var _ = Describe("Catalog represents a store of bundles which OLM can use to ins
272
269
})
273
270
Expect (err ).ShouldNot (HaveOccurred ())
274
271
272
+ var updatedConfigMap * corev1.ConfigMap
273
+ Eventually (func () (types.UID , error ) {
274
+ var err error
275
+ // Get updated configmap
276
+ updatedConfigMap , err = c .KubernetesInterface ().CoreV1 ().ConfigMaps (testNamespace ).Get (context .Background (), fetchedInitialCatalog .Spec .ConfigMap , metav1.GetOptions {})
277
+ if err != nil {
278
+ return "" , err
279
+ }
280
+ if len (updatedConfigMap .ObjectMeta .OwnerReferences ) == 0 {
281
+ return "" , nil
282
+ }
283
+ return updatedConfigMap .ObjectMeta .OwnerReferences [0 ].UID , nil
284
+ }).Should (Equal (fetchedUpdatedCatalog .ObjectMeta .UID ))
285
+
275
286
Expect (configMap .ResourceVersion ).ShouldNot (Equal (updatedConfigMap .ResourceVersion ))
276
287
Expect (fetchedInitialCatalog .Status .ConfigMapResource .ResourceVersion ).ShouldNot (Equal (fetchedUpdatedCatalog .Status .ConfigMapResource .ResourceVersion ))
277
288
Expect (fetchedUpdatedCatalog .Status .ConfigMapResource .ResourceVersion ).Should (Equal (updatedConfigMap .GetResourceVersion ()))
0 commit comments