File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 1
1
package semver
2
2
3
3
import (
4
+ "cmp"
4
5
"context"
5
6
"fmt"
6
7
"io"
8
+ "slices"
7
9
"sort"
8
10
9
11
"github.com/blang/semver/v4"
@@ -283,8 +285,6 @@ func (sv *semverTemplate) generateChannels(semverChannels *bundleVersions) []dec
283
285
}
284
286
285
287
func (sv * semverTemplate ) linkChannels (unlinkedChannels map [string ]* declcfg.Channel , harvestedVersions * bundleVersions ) []declcfg.Channel {
286
- channels := []declcfg.Channel {}
287
-
288
288
// bundle --> version lookup
289
289
bundleVersions := make (map [string ]semver.Version )
290
290
for _ , vs := range * harvestedVersions {
@@ -295,6 +295,7 @@ func (sv *semverTemplate) linkChannels(unlinkedChannels map[string]*declcfg.Chan
295
295
}
296
296
}
297
297
298
+ channels := make ([]declcfg.Channel , 0 , len (unlinkedChannels ))
298
299
for _ , channel := range unlinkedChannels {
299
300
entries := & channel .Entries
300
301
sort .Slice (* entries , func (i , j int ) bool {
@@ -350,6 +351,10 @@ func (sv *semverTemplate) linkChannels(unlinkedChannels map[string]*declcfg.Chan
350
351
channels = append (channels , * channel )
351
352
}
352
353
354
+ slices .SortFunc (channels , func (a , b declcfg.Channel ) int {
355
+ return cmp .Compare (a .Name , b .Name )
356
+ })
357
+
353
358
return channels
354
359
}
355
360
You can’t perform that action at this time.
0 commit comments