Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bundle validate does not respect the --verbose-flag #3793

Closed
JAORMX opened this issue Aug 27, 2020 · 0 comments · Fixed by #3795
Closed

bundle validate does not respect the --verbose-flag #3793

JAORMX opened this issue Aug 27, 2020 · 0 comments · Fixed by #3795
Labels
language/go Issue is related to a Go operator project

Comments

@JAORMX
Copy link
Contributor

JAORMX commented Aug 27, 2020

Bug Report

What did you do?

When running operator-sdk bundle validate with the verbose flag, I expected to get some debugging output.

What did you expect to see?

What I expected to see, for instance, was the arguments that the command uses to call podman.

When forcing the debug flag on to the logger that the command uses, I expected to see something like the following:

$ operator-sdk bundle validate --verbose --image-builder <image path> 
DEBU[0000] Debug logging is set                         
INFO[0000] Unpacking image layers                       
DEBU[0000] Pulling and unpacking container image         bundle-dir=/tmp/bundle-307171452 container-tool=podman
INFO[0000] running podman create                        
DEBU[0000] [podman create quay.io/compliance-operator/compliance-operator-bundle1:latest ] 
INFO[0000] running podman cp                            
DEBU[0000] [podman cp ce422dd5ee45e945c31997252e74d89d12a7e3148a7e5d57cbe4ebe9c91d9095:/ /tmp/bundle-307171452] 
INFO[0000] running podman rm                            
DEBU[0000] [podman rm ce422dd5ee45e945c31997252e74d89d12a7e3148a7e5d57cbe4ebe9c91d9095] 
DEBU[0000] Found manifests directory                     bundle-dir=/tmp/bundle-307171452 container-tool=podman
DEBU[0000] Found metadata directory                      bundle-dir=/tmp/bundle-307171452 container-tool=podman
DEBU[0000] Getting mediaType info from manifests directory  bundle-dir=/tmp/bundle-307171452 container-tool=podman
INFO[0000] Found annotations file                        bundle-dir=/tmp/bundle-307171452 container-tool=podman
INFO[0000] Could not find optional dependencies file     bundle-dir=/tmp/bundle-307171452 container-tool=podman
DEBU[0000] Validating bundle contents                    bundle-dir=/tmp/bundle-307171452 container-tool=podman

What did you see instead? Under which circumstances?

As seen below, the debug (verbose) flag is detected, but the output does not reflect what it should.

$ operator-sdk bundle validate --verbose --image-builder <image path> 
DEBU[0000] Debug logging is set                         
INFO[0000] Unpacking image layers                       
DEBU[0000] Pulling and unpacking container image         bundle-dir=/tmp/bundle-387597871 container-tool=podman
INFO[0000] running podman create                        
INFO[0000] running podman cp                            
INFO[0000] running podman rm                            
INFO[0000] Found annotations file                        bundle-dir=/tmp/bundle-387597871 container-tool=podman
INFO[0000] Could not find optional dependencies file     bundle-dir=/tmp/bundle-387597871 container-tool=podman
WARN[0000] Warning: Value compliance.openshift.io/v1alpha1, Kind=ComplianceCheckResult: provided API should have an example annotation 
WARN[0000] Warning: Value compliance.openshift.io/v1alpha1, Kind=ComplianceRemediation: provided API should have an example annotation 
WARN[0000] Warning: Value compliance.openshift.io/v1alpha1, Kind=Profile: provided API should have an example annotation 
WARN[0000] Warning: Value compliance.openshift.io/v1alpha1, Kind=Rule: provided API should have an example annotation 
WARN[0000] Warning: Value compliance.openshift.io/v1alpha1, Kind=Variable: provided API should have an example annotation 
INFO[0000] All validation tests have completed successfully

Environment

Operator type:

/language go

Kubernetes cluster type:

OpenShift

$ operator-sdk version

v0.18.2

$ go version (if language is Go)

go version go1.14.6 linux/amd64

$ kubectl version

Client Version: version.Info{Major:"1", Minor:"18", GitVersion:"v1.18.2-0-g52c56ce", GitCommit:"5fbf625fade0eb366cccaab717100a88d5d18a4a", GitTreeState:"clean", BuildDate:"2020-08-26T03:39:18Z", GoVersion:"go1.14.4", Compiler:"gc", Platform:"linux/amd64"}

Possible Solution

Set the verbosity level in the actual logger instance that's used.

@openshift-ci-robot openshift-ci-robot added the language/go Issue is related to a Go operator project label Aug 27, 2020
JAORMX added a commit to JAORMX/operator-sdk that referenced this issue Aug 27, 2020
This makes the bundle validate subcommand respect the verbosity level
by setting it directly in the logger that's actually used, and not in
the global logger as was done previously.

Closes: operator-framework#3793
JAORMX added a commit to JAORMX/operator-sdk that referenced this issue Aug 27, 2020
This makes the bundle validate subcommand respect the verbosity level
by setting it directly in the logger that's actually used, and not in
the global logger as was done previously.

Closes: operator-framework#3793
JAORMX added a commit to JAORMX/operator-sdk that referenced this issue Aug 27, 2020
This makes the bundle validate subcommand respect the verbosity level
by setting it directly in the logger that's actually used, and not in
the global logger as was done previously.

Closes: operator-framework#3793
JAORMX added a commit to JAORMX/operator-sdk that referenced this issue Aug 28, 2020
This makes the bundle validate subcommand respect the verbosity level
by setting it directly in the logger that's actually used, and not in
the global logger as was done previously.

Closes: operator-framework#3793
asmacdo added a commit that referenced this issue Aug 28, 2020
* Make bundle validate subcommand respect verbosity

This makes the bundle validate subcommand respect the verbosity level
by setting it directly in the logger that's actually used, and not in
the global logger as was done previously.

Closes: #3793

* add unit test 

Co-authored-by: Austin Macdonald <austin@redhat.com>
asmacdo added a commit to asmacdo/operator-sdk that referenced this issue Aug 28, 2020
…#3795)

* Make bundle validate subcommand respect verbosity

This makes the bundle validate subcommand respect the verbosity level
by setting it directly in the logger that's actually used, and not in
the global logger as was done previously.

Closes: operator-framework#3793

* add unit test

Co-authored-by: Austin Macdonald <austin@redhat.com>
asmacdo added a commit that referenced this issue Aug 28, 2020
* Make bundle validate subcommand respect verbosity

This makes the bundle validate subcommand respect the verbosity level
by setting it directly in the logger that's actually used, and not in
the global logger as was done previously.

Closes: #3793

* add unit test

Co-authored-by: Austin Macdonald <austin@redhat.com>

Co-authored-by: Juan Osorio Robles <jaosorior@redhat.com>
joelanford pushed a commit to joelanford/operator-sdk that referenced this issue Sep 17, 2020
…#3795)

* Make bundle validate subcommand respect verbosity

This makes the bundle validate subcommand respect the verbosity level
by setting it directly in the logger that's actually used, and not in
the global logger as was done previously.

Closes: operator-framework#3793

* add unit test 

Co-authored-by: Austin Macdonald <austin@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
language/go Issue is related to a Go operator project
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants