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
Make bundle validate subcommand respect verbosity #3795
Make bundle validate subcommand respect verbosity #3795
Conversation
@JAORMX Can you add a changelog fragment for the bugfix to this PR? Also, btw we typically merge the master PR and then cherry-pick it back to the previous maintained branches. |
@joelanford got it; I'll close the other PRs then. And I'll add the changelog entry |
The travis failure is just a link-checker flake, I checked the failing link and it's working now. I'm not going to restart the job since adding the changelog will run again. |
Pull-request updated, HEAD is now 80b42f8 |
80b42f8
to
4327b78
Compare
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
4327b78
to
4667c51
Compare
// Always print non-output logs to stderr as to not pollute actual command output. | ||
// Note that it allows the JSON result be redirected to the Stdout. E.g | ||
// if we run the command with `| jq . > result.json` the command will print just the logs | ||
// and the file will have only the JSON result. | ||
logger := log.NewEntry(internal.NewLoggerTo(os.Stderr)) | ||
if viper.GetBool(flags.VerboseOpt) { | ||
logger.Logger.SetLevel(log.DebugLevel) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be possible add the unit test to ensure it in validate_test.go?
@JAORMX Thank you! We would like to include this in the 0.19.3 release, and because code freeze for that is today, I went ahead and added the unit test so we can get this merged. I will cherrypick this into 0.19. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
Thanks folks! It's a little late for me already (Friday evening) so I really appreciate the help here |
@@ -18,6 +18,7 @@ import ( | |||
. "github.com/onsi/ginkgo" | |||
. "github.com/onsi/gomega" | |||
"github.com/operator-framework/operator-sdk/internal/cmd/operator-sdk/bundle/internal" | |||
log "github.com/sirupsen/logrus" | |||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to merge first: #3808
You will need to rebase it with the master. So, could you please fix the order of the imports here.
The sdk one should be kept and the end it will be:
import (
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
log "github.com/sirupsen/logrus"
"github.com/operator-framework/operator-sdk/internal/cmd/operator-sdk/bundle/internal"
)
``
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
requires rebase with master and I have a nit comment.
Otherwise, /lgtm
Really tks for your contribution 🥇
/cherry-pick v0.19.x |
@asmacdo: #3795 failed to apply on top of branch "v0.19.x":
In response to this:
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. |
…#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>
* 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>
…#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>
Make bundle validate subcommand respect verbosity
This makes the
bundle validate
subcommand respect the verbosity levelby setting it directly in the logger that's actually used, and not in
the global logger as was done previously.
Closes: #3793