Add String method so quieted output displays properly#1090
Merged
thaJeztah merged 1 commit intodocker:masterfrom May 29, 2018
Merged
Add String method so quieted output displays properly#1090thaJeztah merged 1 commit intodocker:masterfrom
thaJeztah merged 1 commit intodocker:masterfrom
Conversation
Fixes docker#1089 Signed-off-by: Zachary Romero <zacromero3@gmail.com>
Collaborator
|
We should wait for https://jenkins.dockerproject.org/job/docker/job/cli/job/PR-1090 to be done (but somehow there is no node 😭) |
Member
|
Before this patch: cat <<EOF> Dockerfile
FROM busybox
RUN echo foo
EOF
docker build --quiet --stream .
&{%!!(MISSING)s(chan error=0xc42001a960) sha256:a0656916e1769300a230126221760c5d997870d249445f34e7884017a2bf1454
%!!(MISSING)s(*bytes.Buffer=&{[] 0 0 [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]}) %!!(MISSING)s(chan struct {}=0xc42001a9c0) {%!!(MISSING)s(int32=0) %!!(MISSING)s(uint32=0)}}With this patch: cat <<EOF> Dockerfile
FROM busybox
RUN echo foo
EOF
docker build --quiet --stream .
sha256:a0656916e1769300a230126221760c5d997870d249445f34e7884017a2bf1454 |
thaJeztah
reviewed
May 29, 2018
| } | ||
|
|
||
| func (bw *bufferedWriter) String() string { | ||
| return fmt.Sprintf("%s", bw.Writer) |
Member
There was a problem hiding this comment.
Actually, wondering if there's a better solution to convert it to a string 🤔 (at least could be simplified to fmt.Sprint(bw.Writer))
Member
|
Yeah, let's leave it as-is for now |
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.
Fixes #1089 as well as addresses moby/moby#36812
- What I did
It turns out that the when the --stream flag is provided, a struct with a few different fields is used and when trying to print it in the quiet case, it uses a default string representation of the struct. I added a custom String method to only display the relevant data.
- Description for the changelog
Fixed bug displaying garbage output for build command when --stream and --quiet flags combined