operator-sdk
                                
                                 operator-sdk copied to clipboard
                                
                                    operator-sdk copied to clipboard
                            
                            
                            
                        operators.operatorframework.io.bundle.channel.default.v1 annotation ought to be OPTIONAL
Bug Report
time="2022-02-11T05:06:51Z" level=error msg="error validating format in ../preflight-3031960168/fs: Bundle validation errors: Expecting annotation \"operators.operatorframework.io.bundle.channel.default.v1\" to have non-empty value"
What did you do?
Tried to build/validate a bundle without the annotation: operators.operatorframework.io.bundle.channel.default.v1
What did you expect to see?
The bundle check does not fail since it is defined as OPTIONAL at https://github.com/operator-framework/operator-registry/blob/master/docs/design/operator-bundle.md:
The label operators.operatorframework.io.bundle.channel.default.v1 reflects the default channel an operator should be subscribed to when installed from a registry. This label is optional if the default channel has been set by previous bundles and the default channel is unchanged for this bundle.
What did you see instead? Under which circumstances?
time="2022-02-11T05:06:51Z" level=error msg="error validating format in ../preflight-3031960168/fs: Bundle validation errors: Expecting annotation \"operators.operatorframework.io.bundle.channel.default.v1\" to have non-empty value"
Environment
Operator type:
/language go /language ansible /language helm
/cc @varshaprasad96 @jberkhahn
From master the error is:
ERRO[0000] error validating format in testdata/go/v3/memcached-operator/bundle: Bundle validation errors: Expecting annotation "operators.operatorframework.io.bundle.channels.v1" to have non-empty value
@jmrodri the error came from the check done in https://github.com/operator-framework/operator-registry/blob/master/pkg/lib/bundle/validate.go#L213-L218.
According to the doc, it should be OPTIONAL, however, I think we need to confirm with the OLM maintainers. @dinhxuanvu @anik120 do you know if the doc or the code is not accurate in this case? Should the annotation https://github.com/operator-framework/operator-registry/blob/master/pkg/lib/bundle/validate.go#L213-L218 be or not optional?
@camilamacedo86 how do I verify this? I tried the following commands on that PR:
operator-sdk bundle validate 2.0.4
and
operator-sdk bundle validate  --select-optional name=community 2.0.4
What command do I run to get the error you are exhibiting?
You will get this error if the channel is set to an empty string "". You either have to omit the annotation OR set it to a valid value.
Hi @jmrodri,
The documentation describes that it should be OPTIONAL. So, what I was expecting here would be:
- Check if the option should or not be optional
- If the doc is right that we articulate the fix
- if the doc is wrong could we articulate a change on there
Did we check it out and the conclusion was that the doc is wrong or should we re-open this one?
I am reopening this one so we can check if the default channel should or not be optional.
Shows like related : https://github.com/operator-framework/operator-sdk/issues/5760
While my issue is related, I think that the one that I opened is caused because the operator-sdk version is old (1.0.1). Upgrading to the latest version appears to fix my issue -- it no longer injects an empty string into the default channel.
Issues go stale after 90d of inactivity.
Mark the issue as fresh by commenting /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
Exclude this issue from closing by commenting /lifecycle frozen.
If this issue is safe to close now please do so with /close.
/lifecycle stale
Stale issues rot after 30d of inactivity.
Mark the issue as fresh by commenting /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.
Exclude this issue from closing by commenting /lifecycle frozen.
If this issue is safe to close now please do so with /close.
/lifecycle rotten /remove-lifecycle stale
/close
@arewm: Closing this issue.
In response to this:
/close
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.