@@ -859,17 +859,40 @@ func TestUnequalPriority(t *testing.T) {
859859 pkgName := randPkg ()
860860 w := staticCatalogWalker {
861861 "a" : func () (* declcfg.DeclarativeConfig , * catalogd.ClusterCatalogSpec , error ) {
862- return genPackage (pkgName ), & catalogd.ClusterCatalogSpec {Priority : 1 }, nil
862+ return & declcfg.DeclarativeConfig {
863+ Packages : []declcfg.Package {{Name : pkgName }},
864+ Channels : []declcfg.Channel {
865+ {Package : pkgName , Name : "alpha" , Entries : []declcfg.ChannelEntry {
866+ {Name : bundleName (pkgName , "1.0.0" )},
867+ }},
868+ },
869+ Bundles : []declcfg.Bundle {
870+ genBundle (pkgName , "1.0.0" ),
871+ },
872+ Deprecations : []declcfg.Deprecation {},
873+ }, & catalogd.ClusterCatalogSpec {Priority : 1 }, nil
863874 },
864875 "b" : func () (* declcfg.DeclarativeConfig , * catalogd.ClusterCatalogSpec , error ) {
865- return genPackage (pkgName ), & catalogd.ClusterCatalogSpec {Priority : 0 }, nil
876+ return & declcfg.DeclarativeConfig {
877+ Packages : []declcfg.Package {{Name : pkgName }},
878+ Channels : []declcfg.Channel {
879+ {Package : pkgName , Name : "alpha" , Entries : []declcfg.ChannelEntry {
880+ {Name : bundleName (pkgName , "1.1.0" )},
881+ }},
882+ },
883+ Bundles : []declcfg.Bundle {
884+ genBundle (pkgName , "1.1.0" ),
885+ },
886+ Deprecations : []declcfg.Deprecation {},
887+ }, & catalogd.ClusterCatalogSpec {Priority : 0 }, nil
866888 },
867889 }
868890 r := CatalogResolver {WalkCatalogsFunc : w .WalkCatalogs }
869891
870- ce := buildFooClusterExtension (pkgName , "" , ">=1.0.0 <=1.0.1 " , ocv1alpha1 .UpgradeConstraintPolicyEnforce )
871- _ , _ , _ , err := r .Resolve (context .Background (), ce , nil )
892+ ce := buildFooClusterExtension (pkgName , "" , "" , ocv1alpha1 .UpgradeConstraintPolicyEnforce )
893+ _ , gotVersion , _ , err := r .Resolve (context .Background (), ce , nil )
872894 require .NoError (t , err )
895+ require .Equal (t , bsemver .MustParse ("1.0.0" ), * gotVersion )
873896}
874897
875898func TestMultiplePriority (t * testing.T ) {
0 commit comments