Bug 1921727 - operator-sdk bundle validate fails when the icon is not present
Summary: operator-sdk bundle validate fails when the icon is not present
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Operator SDK
Version: 4.7
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: 4.8.0
Assignee: Eric Stroczynski
QA Contact: Fan Jia
URL:
Whiteboard:
: 1921724 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-01-28 13:59 UTC by lgallett
Modified: 2021-06-29 19:10 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause: Bundle validate with optional validators would fail if there was a warning during the validation instead of passing but listing out the warning. Consequence: The optional validator would fail instead of warn on warnings. Fix: Brought in a newer operator-framework/api with the fix. Result: When a warning is detected during validation it should be logged to the CLI but the validation should still pass.
Clone Of:
Environment:
Last Closed: 2021-03-18 22:36:46 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github operator-framework operator-sdk pull 4449 0 None closed Bug 1921727: Bundle validate should not fail because of warnings. 2021-02-12 23:11:10 UTC

Description lgallett 2021-01-28 13:59:30 UTC
Description of problem:

bundle validate command fails when the icon is not present. This is inconsistent with the operator courier tests: https://github.com/operator-framework/operator-courier/blob/master/operatorcourier/const_io.py#L94

How reproducible:

always

Steps to Reproduce:
1. create a csv without an icon
2. run the sdk bundle validate command

Actual results:

error

Expected results:

warning

Additional info:

Comment 1 Jesus M. Rodriguez 2021-01-28 14:48:26 UTC
*** Bug 1921724 has been marked as a duplicate of this bug. ***

Comment 2 Jesus M. Rodriguez 2021-01-28 17:07:28 UTC
Just tried with a recent bundle that had the following entry:

  icon:
  - base64data: ""
    mediatype: ""

$ operator-sdk bundle validate ./bundle
INFO[0000] Found annotations file                        bundle-dir=bundle container-tool=docker
INFO[0000] Could not find optional dependencies file     bundle-dir=bundle container-tool=docker
INFO[0000] All validation tests have completed successfully 

$ echo $?
0

$ operator-sdk version
operator-sdk version: "v1.3.0", commit: "1abf57985b43bf6a59dcd18147b3c574fa57d3f6", kubernetes version: "v1.19.4", go version: "go1.15.3", GOOS: "linux", GOARCH: "amd64"

Comment 3 Jesus M. Rodriguez 2021-01-28 17:09:11 UTC
Removed the entire icon stanza from the CSV. And did bundle validate again.

# backup csv before editing
$ cp bundle/manifests/demo-zeus-operator.clusterserviceversion.yaml demo-zeus-operator.clusterserviceversion.yaml.backup

# remove the icon stanza
$ vi bundle/manifests/demo-zeus-operator.clusterserviceversion.yaml

# verify there's no icon anywhere in the bundle
$ ag icon bundle

# validate bundle
$ operator-sdk bundle validate ./bundle
INFO[0000] Found annotations file                        bundle-dir=bundle container-tool=docker
INFO[0000] Could not find optional dependencies file     bundle-dir=bundle container-tool=docker
INFO[0000] All validation tests have completed successfully 

# exits with 0
$ echo $?
0

Comment 4 Jesus M. Rodriguez 2021-02-01 02:15:36 UTC
Moving this to 4.8 since it won't be in the downstream until 1.4.0 gets synced.

Comment 5 Jesus M. Rodriguez 2021-06-29 19:10:48 UTC
Updated doctext


Note You need to log in before you can comment on or make changes to this bug.