From 5967c271db0f795b979f1725c5596d07cf64ef11 Mon Sep 17 00:00:00 2001 From: Anik Bhattacharjee Date: Tue, 28 Feb 2023 11:04:20 -0500 Subject: [PATCH] Sort channels in lexicographical order in Packagemanifest (#2925) See https://github.com/operator-framework/operator-registry/issues/1069 for more details Signed-off-by: Anik --- .../pkg/package-server/provider/registry.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/vendor/github.com/operator-framework/operator-lifecycle-manager/pkg/package-server/provider/registry.go b/vendor/github.com/operator-framework/operator-lifecycle-manager/pkg/package-server/provider/registry.go index c048e4e8d6..cb48c6efa6 100644 --- a/vendor/github.com/operator-framework/operator-lifecycle-manager/pkg/package-server/provider/registry.go +++ b/vendor/github.com/operator-framework/operator-lifecycle-manager/pkg/package-server/provider/registry.go @@ -512,6 +512,9 @@ func (p *RegistryProvider) List(namespace string, selector labels.Selector) (*op func newPackageManifest(ctx context.Context, logger *logrus.Entry, pkg *api.Package, client *registryClient, entriesByChannel map[string][]operators.ChannelEntry) (*operators.PackageManifest, error) { pkgChannels := pkg.GetChannels() + sort.Slice(pkgChannels, func(i, j int) bool { + return pkgChannels[i].Name < pkgChannels[j].Name + }) catsrc := client.catsrc manifest := &operators.PackageManifest{ ObjectMeta: metav1.ObjectMeta{