Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug 1875247: Add package check for the channel head querying #1748

Merged
merged 2 commits into from Oct 15, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 9 additions & 3 deletions pkg/controller/registry/resolver/resolver.go
Expand Up @@ -554,9 +554,15 @@ func (r *SatResolver) sortChannel(bundles []*Operator) ([]*Operator, error) {
}
}

if len(headCandidates) != 1 {
// TODO: more context in error
return nil, fmt.Errorf("found more than one head for channel")
if len(headCandidates) > 1 {
var names []string
for _, v := range headCandidates {
names = append(names, v.Identifier())
}
return nil, fmt.Errorf("found multiple channel heads: %v, please check the `replaces`/`skipRange` fields of the operator bundles", names)

} else if len(headCandidates) < 1 {
return nil, fmt.Errorf("head of channel not found")
}

head := headCandidates[0]
Expand Down