Skip to content

Commit e4b1532

Browse files
authored
Sort channels in lexicographical order in Packagemanifest (#2925)
See operator-framework/operator-registry#1069 for more details Signed-off-by: Anik <[email protected]>
1 parent 41d3973 commit e4b1532

File tree

2 files changed

+97
-0
lines changed

2 files changed

+97
-0
lines changed

pkg/package-server/provider/registry.go

+3
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)