Skip to content

Commit 5726e1b

Browse files
committed
updates
Signed-off-by: grokspawn <[email protected]>
1 parent cdde802 commit 5726e1b

File tree

3 files changed

+13
-17
lines changed

3 files changed

+13
-17
lines changed

alpha/model/model.go

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -350,24 +350,23 @@ func (b *Bundle) normalizeName() string {
350350
}
351351
}
352352

353-
// order by release, if present
354-
// - label first, if present;
355-
// - then version, if present;
356-
//
357-
// then version
353+
// order by version, then
354+
// release, if present
355+
// - label first, if present
356+
// - then version, if present
358357
func (b *Bundle) Compare(other *Bundle) int {
359358
if b.Name == other.Name {
360359
return 0
361360
}
361+
if b.Version.NE(other.Version) {
362+
return b.Version.Compare(other.Version)
363+
}
362364
if b.Release.Label != other.Release.Label {
363365
return strings.Compare(b.Release.Label, other.Release.Label)
364366
}
365367
if b.Release.Version.NE(other.Release.Version) {
366368
return b.Release.Version.Compare(other.Release.Version)
367369
}
368-
if b.Version.NE(other.Version) {
369-
return b.Version.Compare(other.Version)
370-
}
371370
return 0
372371
}
373372

alpha/template/substitutes/substitutes.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,16 @@ type Template struct {
1515
RenderBundle func(context.Context, string) (*declcfg.DeclarativeConfig, error)
1616
}
1717

18-
type SubstitutesTemplate struct {
19-
Schema string `json:"schema"`
20-
Entries []*declcfg.Meta `json:"entries"`
21-
Substitutes []string `json:"substitutes"`
18+
type SubstitutesForTemplate struct {
19+
Schema string `json:"schema"`
20+
Entries []*declcfg.Meta `json:"entries"`
21+
Substitutions []string `json:"substitutions"`
2222
}
2323

2424
const schema string = "olm.template.substitutes"
2525

26-
func parseSpec(reader io.Reader) (*SubstitutesTemplate, error) {
27-
st := &SubstitutesTemplate{}
26+
func parseSpec(reader io.Reader) (*SubstitutesForTemplate, error) {
27+
st := &SubstitutesForTemplate{}
2828
stDoc := json.RawMessage{}
2929
stDecoder := yaml.NewYAMLOrJSONDecoder(reader, 4096)
3030
err := stDecoder.Decode(&stDoc)

pkg/cache/cache.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -368,9 +368,6 @@ func (c *cache) processPackage(ctx context.Context, reader io.Reader) (packageIn
368368
return nil, err
369369
}
370370

371-
// TODO: for each input channel, adjust the entries to respect re-ordering by release attributes as required
372-
// do so as FBC so that the routine may be made common, and re-used for OLMv1
373-
374371
pkgModel, err := declcfg.ConvertToModel(*pkgFbc)
375372
if err != nil {
376373
return nil, err

0 commit comments

Comments
 (0)