operator-sdk icon indicating copy to clipboard operation
operator-sdk copied to clipboard

operators.operatorframework.io.bundle.channel.default.v1 annotation ought to be OPTIONAL

Open camilamacedo86 opened this issue 3 years ago • 10 comments

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

See: https://github.com/redhat-openshift-ecosystem/certified-operators/pull/486/files#diff-6dd35511658d7b1c202d1add2f8[…]63af05aba09357592c62f764e7eecdR7

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

camilamacedo86 avatar Feb 25 '22 11:02 camilamacedo86

/cc @varshaprasad96 @jberkhahn

jmrodri avatar Mar 07 '22 20:03 jmrodri

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

camilamacedo86 avatar Mar 18 '22 02:03 camilamacedo86

@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 avatar Mar 18 '22 03:03 camilamacedo86

@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?

jmrodri avatar Apr 06 '22 03:04 jmrodri

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.

jmrodri avatar Apr 06 '22 15:04 jmrodri

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?

camilamacedo86 avatar Apr 22 '22 11:04 camilamacedo86

I am reopening this one so we can check if the default channel should or not be optional.

camilamacedo86 avatar May 11 '22 15:05 camilamacedo86

Shows like related : https://github.com/operator-framework/operator-sdk/issues/5760

camilamacedo86 avatar May 12 '22 13:05 camilamacedo86

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.

arewm avatar May 12 '22 14:05 arewm

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

openshift-bot avatar Aug 11 '22 01:08 openshift-bot

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

openshift-bot avatar Sep 10 '22 08:09 openshift-bot

/close

arewm avatar Sep 10 '22 17:09 arewm

@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.

openshift-ci[bot] avatar Sep 10 '22 17:09 openshift-ci[bot]