Skip to content

Commit dd94c7c

Browse files
Merge pull request #1748 from jianzhangbjz/channel
Bug 1875247: Add package check for the channel head querying
2 parents 8b74324 + 3120953 commit dd94c7c

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

pkg/controller/registry/resolver/resolver.go

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -591,9 +591,15 @@ func (r *SatResolver) sortChannel(bundles []*Operator) ([]*Operator, error) {
591591
}
592592
}
593593

594-
if len(headCandidates) != 1 {
595-
// TODO: more context in error
596-
return nil, fmt.Errorf("found more than one head for channel")
594+
if len(headCandidates) > 1 {
595+
var names []string
596+
for _, v := range headCandidates {
597+
names = append(names, v.Identifier())
598+
}
599+
return nil, fmt.Errorf("found multiple channel heads: %v, please check the `replaces`/`skipRange` fields of the operator bundles", names)
600+
601+
} else if len(headCandidates) < 1 {
602+
return nil, fmt.Errorf("head of channel not found")
597603
}
598604

599605
head := headCandidates[0]

0 commit comments

Comments
 (0)