Skip to content

Commit 6f74503

Browse files
fix e2e config map update triggers registry pod rollout failure (#2532)
Signed-off-by: akihikokuroda <[email protected]>
1 parent 8f309b6 commit 6f74503

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

test/e2e/catalog_e2e_test.go

+15-4
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import (
1919
"k8s.io/apimachinery/pkg/api/meta"
2020
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2121
"k8s.io/apimachinery/pkg/labels"
22+
"k8s.io/apimachinery/pkg/types"
2223

2324
"github.com/operator-framework/api/pkg/lib/version"
2425
"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
255256
// Update catalog configmap
256257
updateInternalCatalog(GinkgoT(), c, crc, mainCatalogName, testNamespace, []apiextensions.CustomResourceDefinition{dependentCRD}, []v1alpha1.ClusterServiceVersion{mainCSV, dependentCSV}, append(mainManifests, dependentManifests...))
257258

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-
262259
fetchedUpdatedCatalog, err := fetchCatalogSourceOnStatus(crc, mainCatalogName, testNamespace, func(catalog *v1alpha1.CatalogSource) bool {
263260
before := fetchedInitialCatalog.Status.ConfigMapResource
264261
after := catalog.Status.ConfigMapResource
@@ -272,6 +269,20 @@ var _ = Describe("Catalog represents a store of bundles which OLM can use to ins
272269
})
273270
Expect(err).ShouldNot(HaveOccurred())
274271

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+
275286
Expect(configMap.ResourceVersion).ShouldNot(Equal(updatedConfigMap.ResourceVersion))
276287
Expect(fetchedInitialCatalog.Status.ConfigMapResource.ResourceVersion).ShouldNot(Equal(fetchedUpdatedCatalog.Status.ConfigMapResource.ResourceVersion))
277288
Expect(fetchedUpdatedCatalog.Status.ConfigMapResource.ResourceVersion).Should(Equal(updatedConfigMap.GetResourceVersion()))

0 commit comments

Comments
 (0)