Repository navigation
cmd/image-builder: enable olog on --verbose - #2728
Merged
Merged
Conversation
`setupRootCmd()` reads `--verbose` before `Execute()` has parsed the command line, so it always sees the default and olog keeps discarding its output. This has been the case since a3a62cf ("refactor: use standard logger instead of logrus"). Move the check into a `PersistentPreRunE` on the root command, which runs after parsing and still calls `memProfilePersistentPreRun()` first. Signed-off-by: Andrew Dunn <[email protected]>
avitova
approved these changes
Oct 2, 2026
avitova
left a comment
Contributor
There was a problem hiding this comment.
Thank you! The test coverage is also nice:) Hopefully this will do.
avitova
enabled auto-merge
October 2, 2026 13:16
supakeen
disabled auto-merge
October 2, 2026 13:18
supakeen
self-requested a review
October 2, 2026 13:19
supakeen
approved these changes
Oct 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
image-builder --verbosenever turns on olog, becausesetupRootCmd()reads the flag beforeExecute()parses the command line. I moved the check into aPersistentPreRunEon the root command, which runs after parsing and still callsmemProfilePersistentPreRun()first.This also makes the
osinfolog messages visible underimage-builder --verbose, such as the deprecated-prefix warning from #2648 when building from a bootc container.