@@ -335,6 +335,7 @@ func TestResolver(t *testing.T) {
335
335
name : "SubscriptionOmitsChannel" ,
336
336
clusterState : []runtime.Object {
337
337
newSub (namespace , "package" , "" , catalog ),
338
+ newOperatorGroup ("foo" , namespace ),
338
339
},
339
340
bundlesByCatalog : map [resolvercache.SourceKey ][]* api.Bundle {
340
341
catalog : {
@@ -354,6 +355,7 @@ func TestResolver(t *testing.T) {
354
355
name : "SubscriptionWithNoCandidates/Error" ,
355
356
clusterState : []runtime.Object {
356
357
newSub (namespace , "a" , "alpha" , catalog ),
358
+ newOperatorGroup ("foo" , namespace ),
357
359
},
358
360
out : resolverTestOut {
359
361
solverError : solver.NotSatisfiable {
@@ -372,6 +374,7 @@ func TestResolver(t *testing.T) {
372
374
name : "SubscriptionWithNoCandidatesInPackage/Error" ,
373
375
clusterState : []runtime.Object {
374
376
newSub (namespace , "a" , "alpha" , catalog ),
377
+ newOperatorGroup ("foo" , namespace ),
375
378
},
376
379
bundlesByCatalog : map [resolvercache.SourceKey ][]* api.Bundle {
377
380
catalog : {
@@ -395,6 +398,7 @@ func TestResolver(t *testing.T) {
395
398
name : "SubscriptionWithNoCandidatesInChannel/Error" ,
396
399
clusterState : []runtime.Object {
397
400
newSub (namespace , "a" , "alpha" , catalog ),
401
+ newOperatorGroup ("foo" , namespace ),
398
402
},
399
403
bundlesByCatalog : map [resolvercache.SourceKey ][]* api.Bundle {
400
404
catalog : {
@@ -418,6 +422,7 @@ func TestResolver(t *testing.T) {
418
422
name : "SubscriptionWithNoCandidatesWithStartingCSVName/Error" ,
419
423
clusterState : []runtime.Object {
420
424
newSub (namespace , "a" , "alpha" , catalog , withStartingCSV ("notfound" )),
425
+ newOperatorGroup ("foo" , namespace ),
421
426
},
422
427
bundlesByCatalog : map [resolvercache.SourceKey ][]* api.Bundle {
423
428
catalog : {
@@ -441,6 +446,7 @@ func TestResolver(t *testing.T) {
441
446
name : "SingleNewSubscription/NoDeps" ,
442
447
clusterState : []runtime.Object {
443
448
newSub (namespace , "a" , "alpha" , catalog ),
449
+ newOperatorGroup ("foo" , namespace ),
444
450
},
445
451
bundlesByCatalog : map [resolvercache.SourceKey ][]* api.Bundle {
446
452
catalog : {
@@ -460,6 +466,7 @@ func TestResolver(t *testing.T) {
460
466
name : "SingleNewSubscription/ResolveOne" ,
461
467
clusterState : []runtime.Object {
462
468
newSub (namespace , "a" , "alpha" , catalog ),
469
+ newOperatorGroup ("foo" , namespace ),
463
470
},
464
471
bundlesByCatalog : map [resolvercache.SourceKey ][]* api.Bundle {
465
472
catalog : {
@@ -482,6 +489,7 @@ func TestResolver(t *testing.T) {
482
489
name : "SingleNewSubscription/ResolveOne/BundlePath" ,
483
490
clusterState : []runtime.Object {
484
491
newSub (namespace , "a" , "alpha" , catalog ),
492
+ newOperatorGroup ("foo" , namespace ),
485
493
},
486
494
bundlesByCatalog : map [resolvercache.SourceKey ][]* api.Bundle {
487
495
catalog : {
@@ -528,6 +536,7 @@ func TestResolver(t *testing.T) {
528
536
name : "SingleNewSubscription/ResolveOne/AdditionalBundleObjects" ,
529
537
clusterState : []runtime.Object {
530
538
newSub (namespace , "a" , "alpha" , catalog ),
539
+ newOperatorGroup ("foo" , namespace ),
531
540
},
532
541
bundlesByCatalog : map [resolvercache.SourceKey ][]* api.Bundle {
533
542
catalog : {
@@ -550,6 +559,7 @@ func TestResolver(t *testing.T) {
550
559
name : "SingleNewSubscription/ResolveOne/AdditionalBundleObjects/Service" ,
551
560
clusterState : []runtime.Object {
552
561
newSub (namespace , "a" , "alpha" , catalog ),
562
+ newOperatorGroup ("foo" , namespace ),
553
563
},
554
564
bundlesByCatalog : map [resolvercache.SourceKey ][]* api.Bundle {
555
565
catalog : {
@@ -572,6 +582,7 @@ func TestResolver(t *testing.T) {
572
582
name : "SingleNewSubscription/DependencyMissing" ,
573
583
clusterState : []runtime.Object {
574
584
newSub (namespace , "a" , "alpha" , catalog ),
585
+ newOperatorGroup ("foo" , namespace ),
575
586
},
576
587
bundlesByCatalog : map [resolvercache.SourceKey ][]* api.Bundle {
577
588
catalog : {
@@ -606,6 +617,7 @@ func TestResolver(t *testing.T) {
606
617
clusterState : []runtime.Object {
607
618
existingSub (namespace , "a.v1" , "a" , "alpha" , catalog ),
608
619
existingOperator (namespace , "a.v1" , "a" , "alpha" , "" , Provides1 , nil , nil , nil ),
620
+ newOperatorGroup ("foo" , namespace ),
609
621
},
610
622
bundlesByCatalog : map [resolvercache.SourceKey ][]* api.Bundle {
611
623
catalog : {
@@ -620,6 +632,7 @@ func TestResolver(t *testing.T) {
620
632
existingSub (namespace , "a.v1" , "a" , "alpha" , catalog ),
621
633
existingSub (namespace , "b.v1" , "b" , "alpha" , catalog ),
622
634
existingOperator (namespace , "a.v1" , "a" , "alpha" , "" , Provides1 , nil , nil , nil ),
635
+ newOperatorGroup ("foo" , namespace ),
623
636
},
624
637
bundlesByCatalog : map [resolvercache.SourceKey ][]* api.Bundle {
625
638
catalog : {
@@ -638,6 +651,7 @@ func TestResolver(t *testing.T) {
638
651
clusterState : []runtime.Object {
639
652
newSub (namespace , "a" , "alpha" , catalog ),
640
653
newSub (namespace , "a" , "beta" , catalog ),
654
+ newOperatorGroup ("foo" , namespace ),
641
655
},
642
656
bundlesByCatalog : map [resolvercache.SourceKey ][]* api.Bundle {
643
657
catalog : {
@@ -664,6 +678,7 @@ func TestResolver(t *testing.T) {
664
678
s .Name = s .Name + "-2"
665
679
return
666
680
}(),
681
+ newOperatorGroup ("foo" , namespace ),
667
682
},
668
683
bundlesByCatalog : map [resolvercache.SourceKey ][]* api.Bundle {
669
684
catalog : {
@@ -689,6 +704,7 @@ func TestResolver(t *testing.T) {
689
704
clusterState : []runtime.Object {
690
705
existingOperator ("ns1" , "a.v1" , "a" , "alpha" , "" , nil , nil , nil , nil ),
691
706
existingOperator ("ns2" , "a.v1" , "a" , "alpha" , "" , nil , nil , nil , nil ),
707
+ newOperatorGroup ("foo" , namespace ),
692
708
},
693
709
out : nothing ,
694
710
},
@@ -697,6 +713,7 @@ func TestResolver(t *testing.T) {
697
713
clusterState : []runtime.Object {
698
714
existingSub (namespace , "a.v1" , "a" , "alpha" , catalog ),
699
715
existingOperator (namespace , "a.v1" , "a" , "alpha" , "" , Provides1 , nil , nil , nil ),
716
+ newOperatorGroup ("foo" , namespace ),
700
717
},
701
718
bundlesByCatalog : map [resolvercache.SourceKey ][]* api.Bundle {
702
719
catalog : {
@@ -718,6 +735,7 @@ func TestResolver(t *testing.T) {
718
735
clusterState : []runtime.Object {
719
736
existingSub (namespace , "a.v1" , "a" , "alpha" , catalog ),
720
737
existingOperator (namespace , "a.v1" , "a" , "alpha" , "" , Provides1 , nil , nil , nil ),
738
+ newOperatorGroup ("foo" , namespace ),
721
739
},
722
740
bundlesByCatalog : map [resolvercache.SourceKey ][]* api.Bundle {catalog : {
723
741
stripManifests (withBundlePath (bundle ("a.v2" , "a" , "alpha" , "a.v1" , Provides1 , nil , nil , nil ), "quay.io/test/bundle@sha256:abcd" ))},
@@ -759,6 +777,7 @@ func TestResolver(t *testing.T) {
759
777
name : "InstalledSub/NoRunningOperator" ,
760
778
clusterState : []runtime.Object {
761
779
existingSub (namespace , "a.v1" , "a" , "alpha" , catalog ),
780
+ newOperatorGroup ("foo" , namespace ),
762
781
},
763
782
bundlesByCatalog : map [resolvercache.SourceKey ][]* api.Bundle {
764
783
catalog : {
@@ -778,6 +797,7 @@ func TestResolver(t *testing.T) {
778
797
clusterState : []runtime.Object {
779
798
existingSub (namespace , "a.v1" , "a" , "alpha" , catalog ),
780
799
existingOperator (namespace , "a.v1" , "a" , "alpha" , "" , Provides1 , nil , nil , nil ),
800
+ newOperatorGroup ("foo" , namespace ),
781
801
},
782
802
bundlesByCatalog : map [resolvercache.SourceKey ][]* api.Bundle {
783
803
catalog : {
@@ -802,6 +822,7 @@ func TestResolver(t *testing.T) {
802
822
clusterState : []runtime.Object {
803
823
existingSub (namespace , "a.v1" , "a" , "alpha" , catalog ),
804
824
existingOperator (namespace , "a.v1" , "a" , "alpha" , "" , nil , nil , Provides1 , nil ),
825
+ newOperatorGroup ("foo" , namespace ),
805
826
},
806
827
bundlesByCatalog : map [resolvercache.SourceKey ][]* api.Bundle {
807
828
catalog : {
@@ -827,6 +848,7 @@ func TestResolver(t *testing.T) {
827
848
existingSub (namespace , "a.v1" , "a" , "alpha" , catalog ),
828
849
existingOperator (namespace , "a.v1" , "a" , "alpha" , "" , Provides1 , nil , nil , nil ),
829
850
newSub (namespace , "b" , "beta" , catalog ),
851
+ newOperatorGroup ("foo" , namespace ),
830
852
},
831
853
bundlesByCatalog : map [resolvercache.SourceKey ][]* api.Bundle {
832
854
catalog : {
@@ -851,6 +873,7 @@ func TestResolver(t *testing.T) {
851
873
clusterState : []runtime.Object {
852
874
existingSub (namespace , "a.v1" , "a" , "alpha" , catalog ),
853
875
newSub (namespace , "b" , "beta" , catalog ),
876
+ newOperatorGroup ("foo" , namespace ),
854
877
},
855
878
bundlesByCatalog : map [resolvercache.SourceKey ][]* api.Bundle {
856
879
catalog : {
@@ -873,6 +896,7 @@ func TestResolver(t *testing.T) {
873
896
clusterState : []runtime.Object {
874
897
existingSub (namespace , "a.v1" , "a" , "alpha" , catalog ),
875
898
newSub (namespace , "b" , "beta" , catalog ),
899
+ newOperatorGroup ("foo" , namespace ),
876
900
},
877
901
bundlesByCatalog : map [resolvercache.SourceKey ][]* api.Bundle {
878
902
catalog : {
@@ -898,6 +922,7 @@ func TestResolver(t *testing.T) {
898
922
existingOperator (namespace , "a.v1" , "a" , "alpha" , "" , Provides1 , Requires2 , nil , nil ),
899
923
existingSub (namespace , "b.v1" , "b" , "alpha" , catalog ),
900
924
existingOperator (namespace , "b.v1" , "b" , "alpha" , "" , Provides2 , Requires1 , nil , nil ),
925
+ newOperatorGroup ("foo" , namespace ),
901
926
},
902
927
bundlesByCatalog : map [resolvercache.SourceKey ][]* api.Bundle {
903
928
catalog : {
@@ -924,6 +949,7 @@ func TestResolver(t *testing.T) {
924
949
existingOperator (namespace , "a.v1" , "a" , "alpha" , "" , Provides1 , nil , nil , nil ),
925
950
existingSub (namespace , "b.v1" , "b" , "alpha" , catalog ),
926
951
existingOperator (namespace , "b.v1" , "b" , "alpha" , "" , nil , Requires1 , nil , nil ),
952
+ newOperatorGroup ("foo" , namespace ),
927
953
},
928
954
bundlesByCatalog : map [resolvercache.SourceKey ][]* api.Bundle {
929
955
catalog : {
@@ -946,6 +972,7 @@ func TestResolver(t *testing.T) {
946
972
name : "PicksOlderProvider" ,
947
973
clusterState : []runtime.Object {
948
974
newSub (namespace , "b" , "alpha" , catalog ),
975
+ newOperatorGroup ("foo" , namespace ),
949
976
},
950
977
bundlesByCatalog : map [resolvercache.SourceKey ][]* api.Bundle {
951
978
catalog : {
@@ -970,6 +997,7 @@ func TestResolver(t *testing.T) {
970
997
clusterState : []runtime.Object {
971
998
existingSub (namespace , "a.v1" , "a" , "alpha" , catalog ),
972
999
existingOperator (namespace , "a.v1" , "a" , "alpha" , "" , Provides1 , nil , nil , nil ),
1000
+ newOperatorGroup ("foo" , namespace ),
973
1001
},
974
1002
bundlesByCatalog : map [resolvercache.SourceKey ][]* api.Bundle {catalog : {
975
1003
bundle ("a.v3" , "a" , "alpha" , "a.v2" , nil , nil , nil , nil , withVersion ("1.0.0" ), withSkipRange ("< 1.0.0" )),
@@ -990,6 +1018,7 @@ func TestResolver(t *testing.T) {
990
1018
existingSub (namespace , "b.v1" , "b" , "beta" , catalog ),
991
1019
existingOperator (namespace , "a.v1" , "a" , "alpha" , "" , nil , Requires1 , nil , nil ),
992
1020
existingOperator (namespace , "b.v1" , "b" , "beta" , "" , Provides1 , nil , nil , nil ),
1021
+ newOperatorGroup ("foo" , namespace ),
993
1022
},
994
1023
bundlesByCatalog : map [resolvercache.SourceKey ][]* api.Bundle {
995
1024
catalog : {
@@ -1015,6 +1044,7 @@ func TestResolver(t *testing.T) {
1015
1044
clusterState : []runtime.Object {
1016
1045
existingSub (namespace , "a.v1" , "a" , "alpha" , catalog ),
1017
1046
existingOperator (namespace , "a.v1" , "a" , "alpha" , "" , Provides1 , nil , nil , nil ),
1047
+ newOperatorGroup ("foo" , namespace ),
1018
1048
},
1019
1049
bundlesByCatalog : map [resolvercache.SourceKey ][]* api.Bundle {catalog : {
1020
1050
bundle ("a.v2" , "a" , "alpha" , "" , nil , nil , nil , nil , withVersion ("1.0.0" ), withSkipRange ("< 1.0.0" )),
@@ -1034,6 +1064,7 @@ func TestResolver(t *testing.T) {
1034
1064
name : "NewSub/StartingCSV" ,
1035
1065
clusterState : []runtime.Object {
1036
1066
newSub (namespace , "a" , "alpha" , catalog , withStartingCSV ("a.v2" )),
1067
+ newOperatorGroup ("foo" , namespace ),
1037
1068
},
1038
1069
bundlesByCatalog : map [resolvercache.SourceKey ][]* api.Bundle {catalog : {
1039
1070
bundle ("a.v1" , "a" , "alpha" , "" , nil , nil , nil , nil ),
@@ -1054,6 +1085,7 @@ func TestResolver(t *testing.T) {
1054
1085
clusterState : []runtime.Object {
1055
1086
existingSub (namespace , "a.v1" , "a" , "alpha" , catalog ),
1056
1087
existingOperator (namespace , "a.v1" , "a" , "alpha" , "" , Provides1 , nil , nil , nil ),
1088
+ newOperatorGroup ("foo" , namespace ),
1057
1089
},
1058
1090
bundlesByCatalog : map [resolvercache.SourceKey ][]* api.Bundle {catalog : {
1059
1091
bundle ("a.v2" , "a" , "alpha" , "" , nil , nil , nil , nil , withVersion ("1.0.0" ), withSkips ([]string {"a.v1" })),
@@ -1074,6 +1106,7 @@ func TestResolver(t *testing.T) {
1074
1106
existingSub (namespace , "a.v2" , "a" , "alpha" , catalog ),
1075
1107
existingOperator (namespace , "a.v1" , "a" , "alpha" , "" , Provides1 , nil , nil , nil , withPhase (v1alpha1 .CSVPhaseReplacing )),
1076
1108
existingOperator (namespace , "a.v2" , "a" , "alpha" , "a.v1" , Provides1 , nil , nil , nil , withPhase (v1alpha1 .CSVPhaseFailed )),
1109
+ newOperatorGroup ("foo" , namespace ),
1077
1110
},
1078
1111
bundlesByCatalog : map [resolvercache.SourceKey ][]* api.Bundle {catalog : {
1079
1112
bundle ("a.v1" , "a" , "alpha" , "" , Provides1 , nil , nil , nil , withVersion ("1.0.0" )),
@@ -1121,6 +1154,7 @@ func TestResolver(t *testing.T) {
1121
1154
existingOperator (namespace , "a.v1" , "a" , "alpha" , "" , Provides1 , nil , nil , nil , withPhase (v1alpha1 .CSVPhaseReplacing )),
1122
1155
existingOperator (namespace , "a.v2" , "a" , "alpha" , "a.v1" , Provides1 , nil , nil , nil , withPhase (v1alpha1 .CSVPhaseReplacing )),
1123
1156
existingOperator (namespace , "a.v3" , "a" , "alpha" , "a.v2" , Provides1 , nil , nil , nil , withPhase (v1alpha1 .CSVPhaseFailed )),
1157
+ newOperatorGroup ("foo" , namespace ),
1124
1158
},
1125
1159
bundlesByCatalog : map [resolvercache.SourceKey ][]* api.Bundle {catalog : {
1126
1160
bundle ("a.v1" , "a" , "alpha" , "" , Provides1 , nil , nil , nil , withVersion ("1.0.0" )),
0 commit comments