@@ -91,6 +91,7 @@ func createClusterRoleAndBindingForSA(ctx context.Context, name string, sa *core
9191 "" ,
9292 },
9393 Resources : []string {
94+ "configmaps" ,
9495 "secrets" , // for helm
9596 "services" ,
9697 "serviceaccounts" ,
@@ -289,15 +290,15 @@ func TestClusterExtensionInstallRegistry(t *testing.T) {
289290 for _ , tc := range []testCase {
290291 {
291292 name : "no registry configuration necessary" ,
292- packageName : "prometheus " ,
293+ packageName : "test " ,
293294 },
294295 {
295296 // NOTE: This test requires an extra configuration in /etc/containers/registries.conf, which is mounted
296297 // for this e2e via the ./config/components/registries-conf kustomize component as part of the e2e overlay.
297298 // The goal here is to prove that "mirrored-registry.operator-controller-e2e.svc.cluster.local:5000" is
298299 // mapped to the "real" registry hostname ("docker-registry.operator-controller-e2e.svc.cluster.local:5000").
299300 name : "package requires mirror registry configuration in /etc/containers/registries.conf" ,
300- packageName : "prometheus -mirrored" ,
301+ packageName : "test -mirrored" ,
301302 },
302303 } {
303304 t .Run (tc .name , func (t * testing.T ) {
@@ -361,14 +362,24 @@ func TestClusterExtensionInstallRegistryMultipleBundles(t *testing.T) {
361362 t .Log ("When a cluster extension is installed from a catalog" )
362363
363364 clusterExtension , extensionCatalog , sa , ns := testInit (t )
365+ extraCatalog , err := createTestCatalog (context .Background (), "extra-test-catalog" , os .Getenv (testCatalogRefEnvVar ))
366+ require .NoError (t , err )
367+
364368 defer testCleanup (t , extensionCatalog , clusterExtension , sa , ns )
365369 defer getArtifactsOutput (t )
370+ defer func (cat * catalogd.ClusterCatalog ) {
371+ require .NoError (t , c .Delete (context .Background (), cat ))
372+ require .Eventually (t , func () bool {
373+ err := c .Get (context .Background (), types.NamespacedName {Name : cat .Name }, & catalogd.ClusterCatalog {})
374+ return errors .IsNotFound (err )
375+ }, pollDuration , pollInterval )
376+ }(extraCatalog )
366377
367378 clusterExtension .Spec = ocv1.ClusterExtensionSpec {
368379 Source : ocv1.SourceConfig {
369380 SourceType : "Catalog" ,
370381 Catalog : & ocv1.CatalogSource {
371- PackageName : "prometheus " ,
382+ PackageName : "test " ,
372383 },
373384 },
374385 Namespace : ns .Name ,
@@ -392,7 +403,7 @@ func TestClusterExtensionInstallRegistryMultipleBundles(t *testing.T) {
392403 if assert .NotNil (ct , cond ) {
393404 assert .Equal (ct , metav1 .ConditionTrue , cond .Status )
394405 assert .Equal (ct , ocv1 .ReasonRetrying , cond .Reason )
395- assert .Contains (ct , cond .Message , "in multiple catalogs with the same priority [operatorhubio test-catalog]" )
406+ assert .Contains (ct , cond .Message , "in multiple catalogs with the same priority [extra-test-catalog test-catalog]" )
396407 }
397408 }, pollDuration , pollInterval )
398409}
@@ -410,7 +421,7 @@ func TestClusterExtensionBlockInstallNonSuccessorVersion(t *testing.T) {
410421 Source : ocv1.SourceConfig {
411422 SourceType : "Catalog" ,
412423 Catalog : & ocv1.CatalogSource {
413- PackageName : "prometheus " ,
424+ PackageName : "test " ,
414425 Version : "1.0.0" ,
415426 // No Selector since this is an exact version match
416427 },
@@ -426,7 +437,7 @@ func TestClusterExtensionBlockInstallNonSuccessorVersion(t *testing.T) {
426437 assert .NoError (ct , c .Get (context .Background (), types.NamespacedName {Name : clusterExtension .Name }, clusterExtension ))
427438 assert .Equal (ct ,
428439 & ocv1.ClusterExtensionInstallStatus {Bundle : ocv1.BundleMetadata {
429- Name : "prometheus -operator.1.0.0" ,
440+ Name : "test -operator.1.0.0" ,
430441 Version : "1.0.0" ,
431442 }},
432443 clusterExtension .Status .Install ,
@@ -455,7 +466,7 @@ func TestClusterExtensionBlockInstallNonSuccessorVersion(t *testing.T) {
455466 cond := apimeta .FindStatusCondition (clusterExtension .Status .Conditions , ocv1 .TypeProgressing )
456467 if assert .NotNil (ct , cond ) {
457468 assert .Equal (ct , ocv1 .ReasonRetrying , cond .Reason )
458- assert .Equal (ct , "error upgrading from currently installed version \" 1.0.0\" : no bundles found for package \" prometheus \" matching version \" 1.2.0\" " , cond .Message )
469+ assert .Equal (ct , "error upgrading from currently installed version \" 1.0.0\" : no bundles found for package \" test \" matching version \" 1.2.0\" " , cond .Message )
459470 }
460471 }, pollDuration , pollInterval )
461472}
@@ -473,7 +484,7 @@ func TestClusterExtensionForceInstallNonSuccessorVersion(t *testing.T) {
473484 Source : ocv1.SourceConfig {
474485 SourceType : "Catalog" ,
475486 Catalog : & ocv1.CatalogSource {
476- PackageName : "prometheus " ,
487+ PackageName : "test " ,
477488 Version : "1.0.0" ,
478489 },
479490 },
@@ -522,7 +533,7 @@ func TestClusterExtensionInstallSuccessorVersion(t *testing.T) {
522533 Source : ocv1.SourceConfig {
523534 SourceType : "Catalog" ,
524535 Catalog : & ocv1.CatalogSource {
525- PackageName : "prometheus " ,
536+ PackageName : "test " ,
526537 Version : "1.0.0" ,
527538 },
528539 },
@@ -569,7 +580,7 @@ func TestClusterExtensionInstallReResolvesWhenCatalogIsPatched(t *testing.T) {
569580 Source : ocv1.SourceConfig {
570581 SourceType : "Catalog" ,
571582 Catalog : & ocv1.CatalogSource {
572- PackageName : "prometheus " ,
583+ PackageName : "test " ,
573584 Selector : & metav1.LabelSelector {
574585 MatchExpressions : []metav1.LabelSelectorRequirement {
575586 {
@@ -656,7 +667,7 @@ func TestClusterExtensionInstallReResolvesWhenNewCatalog(t *testing.T) {
656667 Source : ocv1.SourceConfig {
657668 SourceType : "Catalog" ,
658669 Catalog : & ocv1.CatalogSource {
659- PackageName : "prometheus " ,
670+ PackageName : "test " ,
660671 Selector : & metav1.LabelSelector {
661672 MatchLabels : map [string ]string {"olm.operatorframework.io/metadata.name" : extensionCatalog .Name },
662673 },
@@ -717,7 +728,7 @@ func TestClusterExtensionInstallReResolvesWhenManagedContentChanged(t *testing.T
717728 Source : ocv1.SourceConfig {
718729 SourceType : "Catalog" ,
719730 Catalog : & ocv1.CatalogSource {
720- PackageName : "prometheus " ,
731+ PackageName : "test " ,
721732 Selector : & metav1.LabelSelector {
722733 MatchLabels : map [string ]string {"olm.operatorframework.io/metadata.name" : extensionCatalog .Name },
723734 },
@@ -744,17 +755,17 @@ func TestClusterExtensionInstallReResolvesWhenManagedContentChanged(t *testing.T
744755 }, pollDuration , pollInterval )
745756
746757 t .Log ("By deleting a managed resource" )
747- prometheusService := & corev1.Service {
758+ testConfigMap := & corev1.ConfigMap {
748759 ObjectMeta : metav1.ObjectMeta {
749- Name : "prometheus-operator " ,
760+ Name : "test-configmap " ,
750761 Namespace : clusterExtension .Spec .Namespace ,
751762 },
752763 }
753- require .NoError (t , c .Delete (context .Background (), prometheusService ))
764+ require .NoError (t , c .Delete (context .Background (), testConfigMap ))
754765
755766 t .Log ("By eventually re-creating the managed resource" )
756767 require .EventuallyWithT (t , func (ct * assert.CollectT ) {
757- assert .NoError (ct , c .Get (context .Background (), types.NamespacedName {Name : prometheusService .Name , Namespace : prometheusService .Namespace }, prometheusService ))
768+ assert .NoError (ct , c .Get (context .Background (), types.NamespacedName {Name : testConfigMap .Name , Namespace : testConfigMap .Namespace }, testConfigMap ))
758769 }, pollDuration , pollInterval )
759770}
760771
@@ -780,7 +791,7 @@ func TestClusterExtensionRecoversFromInitialInstallFailedWhenFailureFixed(t *tes
780791 Source : ocv1.SourceConfig {
781792 SourceType : "Catalog" ,
782793 Catalog : & ocv1.CatalogSource {
783- PackageName : "prometheus " ,
794+ PackageName : "test " ,
784795 Selector : & metav1.LabelSelector {
785796 MatchLabels : map [string ]string {"olm.operatorframework.io/metadata.name" : extensionCatalog .Name },
786797 },
0 commit comments