@@ -335,6 +335,7 @@ func TestResolver(t *testing.T) {
335335 name : "SubscriptionOmitsChannel" ,
336336 clusterState : []runtime.Object {
337337 newSub (namespace , "package" , "" , catalog ),
338+ newOperatorGroup ("foo" , namespace ),
338339 },
339340 bundlesByCatalog : map [resolvercache.SourceKey ][]* api.Bundle {
340341 catalog : {
@@ -354,6 +355,7 @@ func TestResolver(t *testing.T) {
354355 name : "SubscriptionWithNoCandidates/Error" ,
355356 clusterState : []runtime.Object {
356357 newSub (namespace , "a" , "alpha" , catalog ),
358+ newOperatorGroup ("foo" , namespace ),
357359 },
358360 out : resolverTestOut {
359361 solverError : solver.NotSatisfiable {
@@ -372,6 +374,7 @@ func TestResolver(t *testing.T) {
372374 name : "SubscriptionWithNoCandidatesInPackage/Error" ,
373375 clusterState : []runtime.Object {
374376 newSub (namespace , "a" , "alpha" , catalog ),
377+ newOperatorGroup ("foo" , namespace ),
375378 },
376379 bundlesByCatalog : map [resolvercache.SourceKey ][]* api.Bundle {
377380 catalog : {
@@ -395,6 +398,7 @@ func TestResolver(t *testing.T) {
395398 name : "SubscriptionWithNoCandidatesInChannel/Error" ,
396399 clusterState : []runtime.Object {
397400 newSub (namespace , "a" , "alpha" , catalog ),
401+ newOperatorGroup ("foo" , namespace ),
398402 },
399403 bundlesByCatalog : map [resolvercache.SourceKey ][]* api.Bundle {
400404 catalog : {
@@ -418,6 +422,7 @@ func TestResolver(t *testing.T) {
418422 name : "SubscriptionWithNoCandidatesWithStartingCSVName/Error" ,
419423 clusterState : []runtime.Object {
420424 newSub (namespace , "a" , "alpha" , catalog , withStartingCSV ("notfound" )),
425+ newOperatorGroup ("foo" , namespace ),
421426 },
422427 bundlesByCatalog : map [resolvercache.SourceKey ][]* api.Bundle {
423428 catalog : {
@@ -441,6 +446,7 @@ func TestResolver(t *testing.T) {
441446 name : "SingleNewSubscription/NoDeps" ,
442447 clusterState : []runtime.Object {
443448 newSub (namespace , "a" , "alpha" , catalog ),
449+ newOperatorGroup ("foo" , namespace ),
444450 },
445451 bundlesByCatalog : map [resolvercache.SourceKey ][]* api.Bundle {
446452 catalog : {
@@ -460,6 +466,7 @@ func TestResolver(t *testing.T) {
460466 name : "SingleNewSubscription/ResolveOne" ,
461467 clusterState : []runtime.Object {
462468 newSub (namespace , "a" , "alpha" , catalog ),
469+ newOperatorGroup ("foo" , namespace ),
463470 },
464471 bundlesByCatalog : map [resolvercache.SourceKey ][]* api.Bundle {
465472 catalog : {
@@ -482,6 +489,7 @@ func TestResolver(t *testing.T) {
482489 name : "SingleNewSubscription/ResolveOne/BundlePath" ,
483490 clusterState : []runtime.Object {
484491 newSub (namespace , "a" , "alpha" , catalog ),
492+ newOperatorGroup ("foo" , namespace ),
485493 },
486494 bundlesByCatalog : map [resolvercache.SourceKey ][]* api.Bundle {
487495 catalog : {
@@ -528,6 +536,7 @@ func TestResolver(t *testing.T) {
528536 name : "SingleNewSubscription/ResolveOne/AdditionalBundleObjects" ,
529537 clusterState : []runtime.Object {
530538 newSub (namespace , "a" , "alpha" , catalog ),
539+ newOperatorGroup ("foo" , namespace ),
531540 },
532541 bundlesByCatalog : map [resolvercache.SourceKey ][]* api.Bundle {
533542 catalog : {
@@ -550,6 +559,7 @@ func TestResolver(t *testing.T) {
550559 name : "SingleNewSubscription/ResolveOne/AdditionalBundleObjects/Service" ,
551560 clusterState : []runtime.Object {
552561 newSub (namespace , "a" , "alpha" , catalog ),
562+ newOperatorGroup ("foo" , namespace ),
553563 },
554564 bundlesByCatalog : map [resolvercache.SourceKey ][]* api.Bundle {
555565 catalog : {
@@ -572,6 +582,7 @@ func TestResolver(t *testing.T) {
572582 name : "SingleNewSubscription/DependencyMissing" ,
573583 clusterState : []runtime.Object {
574584 newSub (namespace , "a" , "alpha" , catalog ),
585+ newOperatorGroup ("foo" , namespace ),
575586 },
576587 bundlesByCatalog : map [resolvercache.SourceKey ][]* api.Bundle {
577588 catalog : {
@@ -606,6 +617,7 @@ func TestResolver(t *testing.T) {
606617 clusterState : []runtime.Object {
607618 existingSub (namespace , "a.v1" , "a" , "alpha" , catalog ),
608619 existingOperator (namespace , "a.v1" , "a" , "alpha" , "" , Provides1 , nil , nil , nil ),
620+ newOperatorGroup ("foo" , namespace ),
609621 },
610622 bundlesByCatalog : map [resolvercache.SourceKey ][]* api.Bundle {
611623 catalog : {
@@ -620,6 +632,7 @@ func TestResolver(t *testing.T) {
620632 existingSub (namespace , "a.v1" , "a" , "alpha" , catalog ),
621633 existingSub (namespace , "b.v1" , "b" , "alpha" , catalog ),
622634 existingOperator (namespace , "a.v1" , "a" , "alpha" , "" , Provides1 , nil , nil , nil ),
635+ newOperatorGroup ("foo" , namespace ),
623636 },
624637 bundlesByCatalog : map [resolvercache.SourceKey ][]* api.Bundle {
625638 catalog : {
@@ -638,6 +651,7 @@ func TestResolver(t *testing.T) {
638651 clusterState : []runtime.Object {
639652 newSub (namespace , "a" , "alpha" , catalog ),
640653 newSub (namespace , "a" , "beta" , catalog ),
654+ newOperatorGroup ("foo" , namespace ),
641655 },
642656 bundlesByCatalog : map [resolvercache.SourceKey ][]* api.Bundle {
643657 catalog : {
@@ -664,6 +678,7 @@ func TestResolver(t *testing.T) {
664678 s .Name = s .Name + "-2"
665679 return
666680 }(),
681+ newOperatorGroup ("foo" , namespace ),
667682 },
668683 bundlesByCatalog : map [resolvercache.SourceKey ][]* api.Bundle {
669684 catalog : {
@@ -689,6 +704,7 @@ func TestResolver(t *testing.T) {
689704 clusterState : []runtime.Object {
690705 existingOperator ("ns1" , "a.v1" , "a" , "alpha" , "" , nil , nil , nil , nil ),
691706 existingOperator ("ns2" , "a.v1" , "a" , "alpha" , "" , nil , nil , nil , nil ),
707+ newOperatorGroup ("foo" , namespace ),
692708 },
693709 out : nothing ,
694710 },
@@ -697,6 +713,7 @@ func TestResolver(t *testing.T) {
697713 clusterState : []runtime.Object {
698714 existingSub (namespace , "a.v1" , "a" , "alpha" , catalog ),
699715 existingOperator (namespace , "a.v1" , "a" , "alpha" , "" , Provides1 , nil , nil , nil ),
716+ newOperatorGroup ("foo" , namespace ),
700717 },
701718 bundlesByCatalog : map [resolvercache.SourceKey ][]* api.Bundle {
702719 catalog : {
@@ -718,6 +735,7 @@ func TestResolver(t *testing.T) {
718735 clusterState : []runtime.Object {
719736 existingSub (namespace , "a.v1" , "a" , "alpha" , catalog ),
720737 existingOperator (namespace , "a.v1" , "a" , "alpha" , "" , Provides1 , nil , nil , nil ),
738+ newOperatorGroup ("foo" , namespace ),
721739 },
722740 bundlesByCatalog : map [resolvercache.SourceKey ][]* api.Bundle {catalog : {
723741 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) {
759777 name : "InstalledSub/NoRunningOperator" ,
760778 clusterState : []runtime.Object {
761779 existingSub (namespace , "a.v1" , "a" , "alpha" , catalog ),
780+ newOperatorGroup ("foo" , namespace ),
762781 },
763782 bundlesByCatalog : map [resolvercache.SourceKey ][]* api.Bundle {
764783 catalog : {
@@ -778,6 +797,7 @@ func TestResolver(t *testing.T) {
778797 clusterState : []runtime.Object {
779798 existingSub (namespace , "a.v1" , "a" , "alpha" , catalog ),
780799 existingOperator (namespace , "a.v1" , "a" , "alpha" , "" , Provides1 , nil , nil , nil ),
800+ newOperatorGroup ("foo" , namespace ),
781801 },
782802 bundlesByCatalog : map [resolvercache.SourceKey ][]* api.Bundle {
783803 catalog : {
@@ -802,6 +822,7 @@ func TestResolver(t *testing.T) {
802822 clusterState : []runtime.Object {
803823 existingSub (namespace , "a.v1" , "a" , "alpha" , catalog ),
804824 existingOperator (namespace , "a.v1" , "a" , "alpha" , "" , nil , nil , Provides1 , nil ),
825+ newOperatorGroup ("foo" , namespace ),
805826 },
806827 bundlesByCatalog : map [resolvercache.SourceKey ][]* api.Bundle {
807828 catalog : {
@@ -827,6 +848,7 @@ func TestResolver(t *testing.T) {
827848 existingSub (namespace , "a.v1" , "a" , "alpha" , catalog ),
828849 existingOperator (namespace , "a.v1" , "a" , "alpha" , "" , Provides1 , nil , nil , nil ),
829850 newSub (namespace , "b" , "beta" , catalog ),
851+ newOperatorGroup ("foo" , namespace ),
830852 },
831853 bundlesByCatalog : map [resolvercache.SourceKey ][]* api.Bundle {
832854 catalog : {
@@ -851,6 +873,7 @@ func TestResolver(t *testing.T) {
851873 clusterState : []runtime.Object {
852874 existingSub (namespace , "a.v1" , "a" , "alpha" , catalog ),
853875 newSub (namespace , "b" , "beta" , catalog ),
876+ newOperatorGroup ("foo" , namespace ),
854877 },
855878 bundlesByCatalog : map [resolvercache.SourceKey ][]* api.Bundle {
856879 catalog : {
@@ -873,6 +896,7 @@ func TestResolver(t *testing.T) {
873896 clusterState : []runtime.Object {
874897 existingSub (namespace , "a.v1" , "a" , "alpha" , catalog ),
875898 newSub (namespace , "b" , "beta" , catalog ),
899+ newOperatorGroup ("foo" , namespace ),
876900 },
877901 bundlesByCatalog : map [resolvercache.SourceKey ][]* api.Bundle {
878902 catalog : {
@@ -898,6 +922,7 @@ func TestResolver(t *testing.T) {
898922 existingOperator (namespace , "a.v1" , "a" , "alpha" , "" , Provides1 , Requires2 , nil , nil ),
899923 existingSub (namespace , "b.v1" , "b" , "alpha" , catalog ),
900924 existingOperator (namespace , "b.v1" , "b" , "alpha" , "" , Provides2 , Requires1 , nil , nil ),
925+ newOperatorGroup ("foo" , namespace ),
901926 },
902927 bundlesByCatalog : map [resolvercache.SourceKey ][]* api.Bundle {
903928 catalog : {
@@ -924,6 +949,7 @@ func TestResolver(t *testing.T) {
924949 existingOperator (namespace , "a.v1" , "a" , "alpha" , "" , Provides1 , nil , nil , nil ),
925950 existingSub (namespace , "b.v1" , "b" , "alpha" , catalog ),
926951 existingOperator (namespace , "b.v1" , "b" , "alpha" , "" , nil , Requires1 , nil , nil ),
952+ newOperatorGroup ("foo" , namespace ),
927953 },
928954 bundlesByCatalog : map [resolvercache.SourceKey ][]* api.Bundle {
929955 catalog : {
@@ -946,6 +972,7 @@ func TestResolver(t *testing.T) {
946972 name : "PicksOlderProvider" ,
947973 clusterState : []runtime.Object {
948974 newSub (namespace , "b" , "alpha" , catalog ),
975+ newOperatorGroup ("foo" , namespace ),
949976 },
950977 bundlesByCatalog : map [resolvercache.SourceKey ][]* api.Bundle {
951978 catalog : {
@@ -970,6 +997,7 @@ func TestResolver(t *testing.T) {
970997 clusterState : []runtime.Object {
971998 existingSub (namespace , "a.v1" , "a" , "alpha" , catalog ),
972999 existingOperator (namespace , "a.v1" , "a" , "alpha" , "" , Provides1 , nil , nil , nil ),
1000+ newOperatorGroup ("foo" , namespace ),
9731001 },
9741002 bundlesByCatalog : map [resolvercache.SourceKey ][]* api.Bundle {catalog : {
9751003 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) {
9901018 existingSub (namespace , "b.v1" , "b" , "beta" , catalog ),
9911019 existingOperator (namespace , "a.v1" , "a" , "alpha" , "" , nil , Requires1 , nil , nil ),
9921020 existingOperator (namespace , "b.v1" , "b" , "beta" , "" , Provides1 , nil , nil , nil ),
1021+ newOperatorGroup ("foo" , namespace ),
9931022 },
9941023 bundlesByCatalog : map [resolvercache.SourceKey ][]* api.Bundle {
9951024 catalog : {
@@ -1015,6 +1044,7 @@ func TestResolver(t *testing.T) {
10151044 clusterState : []runtime.Object {
10161045 existingSub (namespace , "a.v1" , "a" , "alpha" , catalog ),
10171046 existingOperator (namespace , "a.v1" , "a" , "alpha" , "" , Provides1 , nil , nil , nil ),
1047+ newOperatorGroup ("foo" , namespace ),
10181048 },
10191049 bundlesByCatalog : map [resolvercache.SourceKey ][]* api.Bundle {catalog : {
10201050 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) {
10341064 name : "NewSub/StartingCSV" ,
10351065 clusterState : []runtime.Object {
10361066 newSub (namespace , "a" , "alpha" , catalog , withStartingCSV ("a.v2" )),
1067+ newOperatorGroup ("foo" , namespace ),
10371068 },
10381069 bundlesByCatalog : map [resolvercache.SourceKey ][]* api.Bundle {catalog : {
10391070 bundle ("a.v1" , "a" , "alpha" , "" , nil , nil , nil , nil ),
@@ -1054,6 +1085,7 @@ func TestResolver(t *testing.T) {
10541085 clusterState : []runtime.Object {
10551086 existingSub (namespace , "a.v1" , "a" , "alpha" , catalog ),
10561087 existingOperator (namespace , "a.v1" , "a" , "alpha" , "" , Provides1 , nil , nil , nil ),
1088+ newOperatorGroup ("foo" , namespace ),
10571089 },
10581090 bundlesByCatalog : map [resolvercache.SourceKey ][]* api.Bundle {catalog : {
10591091 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) {
10741106 existingSub (namespace , "a.v2" , "a" , "alpha" , catalog ),
10751107 existingOperator (namespace , "a.v1" , "a" , "alpha" , "" , Provides1 , nil , nil , nil , withPhase (v1alpha1 .CSVPhaseReplacing )),
10761108 existingOperator (namespace , "a.v2" , "a" , "alpha" , "a.v1" , Provides1 , nil , nil , nil , withPhase (v1alpha1 .CSVPhaseFailed )),
1109+ newOperatorGroup ("foo" , namespace ),
10771110 },
10781111 bundlesByCatalog : map [resolvercache.SourceKey ][]* api.Bundle {catalog : {
10791112 bundle ("a.v1" , "a" , "alpha" , "" , Provides1 , nil , nil , nil , withVersion ("1.0.0" )),
@@ -1121,6 +1154,7 @@ func TestResolver(t *testing.T) {
11211154 existingOperator (namespace , "a.v1" , "a" , "alpha" , "" , Provides1 , nil , nil , nil , withPhase (v1alpha1 .CSVPhaseReplacing )),
11221155 existingOperator (namespace , "a.v2" , "a" , "alpha" , "a.v1" , Provides1 , nil , nil , nil , withPhase (v1alpha1 .CSVPhaseReplacing )),
11231156 existingOperator (namespace , "a.v3" , "a" , "alpha" , "a.v2" , Provides1 , nil , nil , nil , withPhase (v1alpha1 .CSVPhaseFailed )),
1157+ newOperatorGroup ("foo" , namespace ),
11241158 },
11251159 bundlesByCatalog : map [resolvercache.SourceKey ][]* api.Bundle {catalog : {
11261160 bundle ("a.v1" , "a" , "alpha" , "" , Provides1 , nil , nil , nil , withVersion ("1.0.0" )),
0 commit comments