Skip to content

cmd/image-builder: enable olog on --verbose - #2728

Merged
supakeen merged 1 commit into
osbuild:mainfrom
andrewdunndev:image-builder-verbose-olog
Oct 2, 2026
Merged

supakeen merged 1 commit into
osbuild:mainfrom
andrewdunndev:image-builder-verbose-olog

Conversation

@andrewdunndev

Copy link
Copy Markdown
Contributor

image-builder --verbose never turns on olog, because setupRootCmd() reads the flag before Execute() parses the command line. I moved the check into a PersistentPreRunE on the root command, which runs after parsing and still calls memProfilePersistentPreRun() first.

This also makes the osinfo log messages visible under image-builder --verbose, such as the deprecated-prefix warning from #2648 when building from a bootc container.

`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 avitova left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! The test coverage is also nice:) Hopefully this will do.

@avitova
avitova enabled auto-merge October 2, 2026 13:16
@supakeen
supakeen disabled auto-merge October 2, 2026 13:18
@supakeen
supakeen self-requested a review October 2, 2026 13:19
@supakeen
supakeen added this pull request to the merge queue Oct 2, 2026
Merged via the queue into osbuild:main with commit 3588ba7 Oct 2, 2026
54 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants