Repository navigation
Conversation
In quiet mode stdout should only carry the command result (for `pack build -q`, the image reference), but warnings were still written to stdout. On a daemon using the containerd image store, the containerd-storage warning ended up in front of the image reference, so `ref=$(pack build -q ...)` captured three lines instead of one. Send warnings to the error writer when quiet is set, and restore the exact-match assertion in the quiet-mode local build test that was relaxed in buildpacks#2730. Signed-off-by: YuMin Kim <yuminkim.dev@gmail.com>
ToniAdreal
reviewed
Nov 11, 2026
There was a problem hiding this comment.
Verified locally against the reported issue (#2733).
The fix is the first of the two options the issue proposes, and it is the right one: in quiet mode stdout is reserved for command output, so warnings belong on stderr rather than being suppressed. WriterForLevel now routes WarnLevel to errOut when the logger level is quietLevel; the non-quiet path is untouched (warnings still go to stdout by default).
What I checked, locally:
- RED: base
cddf381+ only the PR's two test files applied —go test ./pkg/logging/ -run TestLogWithWritersgives 18 passed / 1 failed. The single failure is the newquiet is set to true / logs warnings to error writerassertion: stdout held"Warning: warn_\nWarning: warnf\n"instead of being empty. That is exactly the reported bug. - GREEN: PR head
dd36b6b— fullgo test ./pkg/logging/passes, including the renamed quiet-mode warnings test and the default-context test that still asserts warnings go to the standard writer when not quiet. - GREEN (verified 04:12–04:16):
go test ./pkg/client/ -run TestBuildon PR headdd36b6b— 137 passed / 0 failed / 15 skipped (152 total, 180.7s). Both quiet-mode specs pass, includingQuiet_mode/local/only_prints_app_name_and_sha(the restored exact-match assertion on stdout). First attempt failed only because /tmp was 100% full (test writes buildpack tars viaos.MkdirTemp); rerun with TMPDIR on the home disk passed. Log:hidden_files/pack-2734/test-client-11090410.log. - Sibling check: the only non-test caller of
WriterForLeveloutsidepkg/loggingispkg/image/fetcher.go:322, and it requestsInfoLevel, so this change cannot affect it.ErrorLevelalready went to stderr;Debug/Infoare still discarded in quiet mode. - CI on the head is all green (test linux/macos/windows, acceptance-combo, CodeQL, DCO).
Two non-blocking notes: the PR has no description text (the linked issue carries the context, so nothing is lost), and mergeable_state is behind — the base has moved since 2026-11-03, so a rebase will be needed before merge.
This branch has not been deployed
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.
Summary
In quiet mode the log level is Warn, and
LogWithWriters.WriterForLevelsent warnings to stdout. On a daemon using the containerd image store,pack build -q <image>therefore printed the containerd-storage warning (#2272) before the image reference, soref=$(pack build -q ...)captured three lines instead of one.This change makes
WriterForLevelreturn the error writer for warnings when quiet is set, so stdout carries only the command result. Non-quiet output is unchanged (warnings still go to stdout).Tests:
pkg/logging: the quiet-mode test now asserts warnings go to the error writer and nothing goes to the standard writer.pkg/client: the build tests use separate stdout/stderr buffers, and theQuiet mode / localtest is back to the exact-match assertion that test: only assert the last line of quiet-mode local build output #2730 relaxed. Against a containerd-store daemon, that test fails without the logger change (the warning appears beforesome/app@sha256:...) and passes with it.Note: this applies to every warning in quiet mode, not only the containerd one, which matches the option suggested in the issue.
Output
Illustrative (not captured from a real
packrun; the behavior is what thepkg/clientquiet-mode test checks):Before
After
The warning is still printed, but on stderr, so
$refcontains onlysome/app@sha256:....Documentation
Related
Resolves #2733
🤖 Generated with Claude Code