@@ -91,6 +91,7 @@ func createClusterRoleAndBindingForSA(ctx context.Context, name string, sa *core
91
91
"" ,
92
92
},
93
93
Resources : []string {
94
+ "configmaps" ,
94
95
"secrets" , // for helm
95
96
"services" ,
96
97
"serviceaccounts" ,
@@ -289,15 +290,15 @@ func TestClusterExtensionInstallRegistry(t *testing.T) {
289
290
for _ , tc := range []testCase {
290
291
{
291
292
name : "no registry configuration necessary" ,
292
- packageName : "prometheus " ,
293
+ packageName : "test " ,
293
294
},
294
295
{
295
296
// NOTE: This test requires an extra configuration in /etc/containers/registries.conf, which is mounted
296
297
// for this e2e via the ./config/components/registries-conf kustomize component as part of the e2e overlay.
297
298
// The goal here is to prove that "mirrored-registry.operator-controller-e2e.svc.cluster.local:5000" is
298
299
// mapped to the "real" registry hostname ("docker-registry.operator-controller-e2e.svc.cluster.local:5000").
299
300
name : "package requires mirror registry configuration in /etc/containers/registries.conf" ,
300
- packageName : "prometheus -mirrored" ,
301
+ packageName : "test -mirrored" ,
301
302
},
302
303
} {
303
304
t .Run (tc .name , func (t * testing.T ) {
@@ -361,14 +362,24 @@ func TestClusterExtensionInstallRegistryMultipleBundles(t *testing.T) {
361
362
t .Log ("When a cluster extension is installed from a catalog" )
362
363
363
364
clusterExtension , extensionCatalog , sa , ns := testInit (t )
365
+ extraCatalog , err := createTestCatalog (context .Background (), "extra-test-catalog" , os .Getenv (testCatalogRefEnvVar ))
366
+ require .NoError (t , err )
367
+
364
368
defer testCleanup (t , extensionCatalog , clusterExtension , sa , ns )
365
369
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 )
366
377
367
378
clusterExtension .Spec = ocv1.ClusterExtensionSpec {
368
379
Source : ocv1.SourceConfig {
369
380
SourceType : "Catalog" ,
370
381
Catalog : & ocv1.CatalogSource {
371
- PackageName : "prometheus " ,
382
+ PackageName : "test " ,
372
383
},
373
384
},
374
385
Namespace : ns .Name ,
@@ -392,7 +403,7 @@ func TestClusterExtensionInstallRegistryMultipleBundles(t *testing.T) {
392
403
if assert .NotNil (ct , cond ) {
393
404
assert .Equal (ct , metav1 .ConditionTrue , cond .Status )
394
405
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]" )
396
407
}
397
408
}, pollDuration , pollInterval )
398
409
}
@@ -410,7 +421,7 @@ func TestClusterExtensionBlockInstallNonSuccessorVersion(t *testing.T) {
410
421
Source : ocv1.SourceConfig {
411
422
SourceType : "Catalog" ,
412
423
Catalog : & ocv1.CatalogSource {
413
- PackageName : "prometheus " ,
424
+ PackageName : "test " ,
414
425
Version : "1.0.0" ,
415
426
// No Selector since this is an exact version match
416
427
},
@@ -426,7 +437,7 @@ func TestClusterExtensionBlockInstallNonSuccessorVersion(t *testing.T) {
426
437
assert .NoError (ct , c .Get (context .Background (), types.NamespacedName {Name : clusterExtension .Name }, clusterExtension ))
427
438
assert .Equal (ct ,
428
439
& ocv1.ClusterExtensionInstallStatus {Bundle : ocv1.BundleMetadata {
429
- Name : "prometheus -operator.1.0.0" ,
440
+ Name : "test -operator.1.0.0" ,
430
441
Version : "1.0.0" ,
431
442
}},
432
443
clusterExtension .Status .Install ,
@@ -455,7 +466,7 @@ func TestClusterExtensionBlockInstallNonSuccessorVersion(t *testing.T) {
455
466
cond := apimeta .FindStatusCondition (clusterExtension .Status .Conditions , ocv1 .TypeProgressing )
456
467
if assert .NotNil (ct , cond ) {
457
468
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 )
459
470
}
460
471
}, pollDuration , pollInterval )
461
472
}
@@ -473,7 +484,7 @@ func TestClusterExtensionForceInstallNonSuccessorVersion(t *testing.T) {
473
484
Source : ocv1.SourceConfig {
474
485
SourceType : "Catalog" ,
475
486
Catalog : & ocv1.CatalogSource {
476
- PackageName : "prometheus " ,
487
+ PackageName : "test " ,
477
488
Version : "1.0.0" ,
478
489
},
479
490
},
@@ -522,7 +533,7 @@ func TestClusterExtensionInstallSuccessorVersion(t *testing.T) {
522
533
Source : ocv1.SourceConfig {
523
534
SourceType : "Catalog" ,
524
535
Catalog : & ocv1.CatalogSource {
525
- PackageName : "prometheus " ,
536
+ PackageName : "test " ,
526
537
Version : "1.0.0" ,
527
538
},
528
539
},
@@ -569,7 +580,7 @@ func TestClusterExtensionInstallReResolvesWhenCatalogIsPatched(t *testing.T) {
569
580
Source : ocv1.SourceConfig {
570
581
SourceType : "Catalog" ,
571
582
Catalog : & ocv1.CatalogSource {
572
- PackageName : "prometheus " ,
583
+ PackageName : "test " ,
573
584
Selector : & metav1.LabelSelector {
574
585
MatchExpressions : []metav1.LabelSelectorRequirement {
575
586
{
@@ -656,7 +667,7 @@ func TestClusterExtensionInstallReResolvesWhenNewCatalog(t *testing.T) {
656
667
Source : ocv1.SourceConfig {
657
668
SourceType : "Catalog" ,
658
669
Catalog : & ocv1.CatalogSource {
659
- PackageName : "prometheus " ,
670
+ PackageName : "test " ,
660
671
Selector : & metav1.LabelSelector {
661
672
MatchLabels : map [string ]string {"olm.operatorframework.io/metadata.name" : extensionCatalog .Name },
662
673
},
@@ -717,7 +728,7 @@ func TestClusterExtensionInstallReResolvesWhenManagedContentChanged(t *testing.T
717
728
Source : ocv1.SourceConfig {
718
729
SourceType : "Catalog" ,
719
730
Catalog : & ocv1.CatalogSource {
720
- PackageName : "prometheus " ,
731
+ PackageName : "test " ,
721
732
Selector : & metav1.LabelSelector {
722
733
MatchLabels : map [string ]string {"olm.operatorframework.io/metadata.name" : extensionCatalog .Name },
723
734
},
@@ -744,17 +755,17 @@ func TestClusterExtensionInstallReResolvesWhenManagedContentChanged(t *testing.T
744
755
}, pollDuration , pollInterval )
745
756
746
757
t .Log ("By deleting a managed resource" )
747
- prometheusService := & corev1.Service {
758
+ testConfigMap := & corev1.ConfigMap {
748
759
ObjectMeta : metav1.ObjectMeta {
749
- Name : "prometheus-operator " ,
760
+ Name : "test-configmap " ,
750
761
Namespace : clusterExtension .Spec .Namespace ,
751
762
},
752
763
}
753
- require .NoError (t , c .Delete (context .Background (), prometheusService ))
764
+ require .NoError (t , c .Delete (context .Background (), testConfigMap ))
754
765
755
766
t .Log ("By eventually re-creating the managed resource" )
756
767
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 ))
758
769
}, pollDuration , pollInterval )
759
770
}
760
771
@@ -780,7 +791,7 @@ func TestClusterExtensionRecoversFromInitialInstallFailedWhenFailureFixed(t *tes
780
791
Source : ocv1.SourceConfig {
781
792
SourceType : "Catalog" ,
782
793
Catalog : & ocv1.CatalogSource {
783
- PackageName : "prometheus " ,
794
+ PackageName : "test " ,
784
795
Selector : & metav1.LabelSelector {
785
796
MatchLabels : map [string ]string {"olm.operatorframework.io/metadata.name" : extensionCatalog .Name },
786
797
},
0 commit comments