@@ -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,15 @@ 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
+ Eventually (func () types.UID {
273
+ // Get updated configmap
274
+ updatedConfigMap , err := c .KubernetesInterface ().CoreV1 ().ConfigMaps (testNamespace ).Get (context .Background (), fetchedInitialCatalog .Spec .ConfigMap , metav1.GetOptions {})
275
+ Expect (err ).ShouldNot (HaveOccurred ())
276
+ return updatedConfigMap .ObjectMeta .OwnerReferences [0 ].UID
277
+ }).Should (Equal (fetchedUpdatedCatalog .ObjectMeta .UID ))
278
+ updatedConfigMap , err := c .KubernetesInterface ().CoreV1 ().ConfigMaps (testNamespace ).Get (context .Background (), fetchedInitialCatalog .Spec .ConfigMap , metav1.GetOptions {})
279
+ Expect (err ).ShouldNot (HaveOccurred ())
280
+
275
281
Expect (configMap .ResourceVersion ).ShouldNot (Equal (updatedConfigMap .ResourceVersion ))
276
282
Expect (fetchedInitialCatalog .Status .ConfigMapResource .ResourceVersion ).ShouldNot (Equal (fetchedUpdatedCatalog .Status .ConfigMapResource .ResourceVersion ))
277
283
Expect (fetchedUpdatedCatalog .Status .ConfigMapResource .ResourceVersion ).Should (Equal (updatedConfigMap .GetResourceVersion ()))
0 commit comments