Generating bundles requires the default channel to be in the list of channels
Use case: As a user, I'd like to have a beta channel with versions ahead of the default stable channel. For example:
Beta v0.2.0 Stable v0.1.0 Default channel = stable
Observed Behavior: I'm trying to generate two channels bundle using operator-sdk and when I run this command I get this error. The operator-sdk tool calls out to the operator-registry code below.
operator-sdk bundle create "quay.io/rh-marketplace/operator-manifest:v$VERSION" --directory "./deploy/olm-catalog/redhat-marketplace-operator/$VERSION" -c beta --package redhat-marketplace-operator-test --default-channel stable --overwrite --verbose
DEBU[0000] Debug logging is set
INFO[0000] Building annotations.yaml
FATA[0000] error building bundle image: error generating bundle image files: The channel list "beta" doesn't contain channelDefault "stable"
My use case is simple, I want to have the beta channel have versions ahead of stable. So I don't want to set this version for both beta and stable, just beta. And I don't want beta to be the default channel.
Manually editing the annotations file allows me to achieve this use-case but I feel like is kind of a nasty work around when such a great tool exists.
Desired Behavior: Default channel can be set to anything without verification inside the generation tool.
Proposed resolution: It looks like just removing this block of code would resolve this: https://github.com/operator-framework/operator-registry/blob/master/pkg/lib/bundle/generate.go#L308-L319
It looks like the opm add index doesn't verify the channels though so there could be a gap if allowing a default channel that doesn't exist.
Alternate proposed solution:
Add registry channels as a field so you can define other channels that are in the registry but not necessarily used for that bundle. I.e. --channels beta --registry-channels beta,stable --default-channel stable
May be similar/related to https://github.com/operator-framework/operator-registry/issues/330 - slightly different use case but fix looks applicable for both.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.