Bug 1921727

Summary: operator-sdk bundle validate fails when the icon is not present
Product: OpenShift Container Platform Reporter: lgallett
Component: Operator SDKAssignee: Eric Stroczynski <estroczy>
Status: CLOSED CURRENTRELEASE QA Contact: Fan Jia <jfan>
Severity: medium Docs Contact:
Priority: medium    
Version: 4.7CC: aos-bugs, fromani, jesusr
Target Milestone: ---   
Target Release: 4.8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
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.
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-03-18 22:36:46 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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