Skip to content

Commit 99b0c51

Browse files
committed
Sort channels in lexicographical order in Packagemanifest
1 parent 4bae06a commit 99b0c51

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pkg/package-server/provider/registry.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,9 @@ func (p *RegistryProvider) List(namespace string, selector labels.Selector) (*op
512512

513513
func newPackageManifest(ctx context.Context, logger *logrus.Entry, pkg *api.Package, client *registryClient, entriesByChannel map[string][]operators.ChannelEntry) (*operators.PackageManifest, error) {
514514
pkgChannels := pkg.GetChannels()
515+
sort.Slice(pkgChannels, func(i, j int) bool {
516+
return pkgChannels[i].Name < pkgChannels[j].Name
517+
})
515518
catsrc := client.catsrc
516519
manifest := &operators.PackageManifest{
517520
ObjectMeta: metav1.ObjectMeta{

0 commit comments

Comments
 (0)