@@ -1027,65 +1027,6 @@ func TestSomeCatalogsDisabled(t *testing.T) {
10271027 require .Equal (t , bsemver .MustParse ("3.0.0" ), * gotVersion )
10281028}
10291029
1030- func TestPriorityRespectedWithDisabledCatalogs (t * testing.T ) {
1031- pkgName := randPkg ()
1032- listCatalogs := func (ctx context.Context , options ... client.ListOption ) ([]catalogd.ClusterCatalog , error ) {
1033- return []catalogd.ClusterCatalog {
1034- {
1035- ObjectMeta : metav1.ObjectMeta {
1036- Name : "enabledCatalog" ,
1037- },
1038- Spec : catalogd.ClusterCatalogSpec {
1039- Priority : 0 , // Lower priority
1040- Availability : "Enabled" ,
1041- },
1042- },
1043- {
1044- ObjectMeta : metav1.ObjectMeta {
1045- Name : "disabledCatalog" ,
1046- },
1047- Spec : catalogd.ClusterCatalogSpec {
1048- Priority : 1 , // Higher priority
1049- Availability : "Disabled" ,
1050- },
1051- },
1052- }, nil
1053- }
1054-
1055- getPackage := func (ctx context.Context , cat * catalogd.ClusterCatalog , packageName string ) (* declcfg.DeclarativeConfig , error ) {
1056- if cat .Spec .Availability == "Disabled" {
1057- panic ("getPackage should not be called for disabled catalogs" )
1058- }
1059- // Enabled catalog returns a lower version
1060- return & declcfg.DeclarativeConfig {
1061- Packages : []declcfg.Package {{Name : pkgName }},
1062- Channels : []declcfg.Channel {
1063- {
1064- Package : pkgName ,
1065- Name : "alpha" ,
1066- Entries : []declcfg.ChannelEntry {
1067- {Name : bundleName (pkgName , "1.0.0" )},
1068- },
1069- },
1070- },
1071- Bundles : []declcfg.Bundle {
1072- genBundle (pkgName , "1.0.0" ),
1073- },
1074- }, nil
1075- }
1076-
1077- r := CatalogResolver {
1078- WalkCatalogsFunc : CatalogWalker (listCatalogs , getPackage ),
1079- }
1080-
1081- ce := buildFooClusterExtension (pkgName , []string {}, "" , ocv1alpha1 .UpgradeConstraintPolicyCatalogProvided )
1082- gotBundle , gotVersion , _ , err := r .Resolve (context .Background (), ce , nil )
1083- require .NoError (t , err )
1084- require .NotNil (t , gotBundle )
1085- require .Equal (t , genBundle (pkgName , "1.0.0" ), * gotBundle )
1086- require .Equal (t , bsemver .MustParse ("1.0.0" ), * gotVersion )
1087- }
1088-
10891030func TestCatalogWithoutAvailabilityIsEnabled (t * testing.T ) {
10901031 pkgName := randPkg ()
10911032 listCatalogs := func (ctx context.Context , options ... client.ListOption ) ([]catalogd.ClusterCatalog , error ) {
0 commit comments