The Wayback Machine - https://web.archive.org/web/20260314094521/https://github.com/docker/cli/pull/1105
Skip to content

Fix panics when --compress and --stream are used together#1105

Merged
vdemeester merged 1 commit intodocker:masterfrom
vdemeester:1044-compress-stream-friend
Jun 1, 2018
Merged

Fix panics when --compress and --stream are used together#1105
vdemeester merged 1 commit intodocker:masterfrom
vdemeester:1044-compress-stream-friend

Conversation

@vdemeester
Copy link
Collaborator

@vdemeester vdemeester commented Jun 1, 2018

Warns that -compress has no effect when used together with the
expremintal --stream flag.

Fixes #1044
Fixes moby/moby#36579

cc @dgageot

Signed-off-by: Vincent Demeester vincent@sbr.pm

)

if options.compress && options.stream {
fmt.Fprintf(dockerCli.Err(), "--compress has no effect when used with --stream")
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: "--compress is ignored when used with --stream" ?

Copy link
Member

Choose a reason for hiding this comment

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

nitnit: or "--compress ignored when used with --stream"?

Copy link
Member

Choose a reason for hiding this comment

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

Still wondering if we should make this a hard error, e.g. we do so here;

return errors.Errorf("--%s conflicts with --health-* options", flagNoHealthcheck)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@thaJeztah my take on this is : --stream is experimental still, and it could make sense that we would like to compress the build stream in the future, that's why I didn't want to error out 👼

Copy link
Member

Choose a reason for hiding this comment

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

Right; so in that case it's even better to error out, because otherwise the option is ignored now (so people can keep using it, it has no effect), but when we implement compression for streaming, the behavior changes, and now the flag does have effect.

Producing an error now, makes sure that nobody uses it

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

alright, seems fair then 👼

}

if options.compress {
if options.compress && !options.stream {
Copy link
Contributor

Choose a reason for hiding this comment

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

Add a comment to explain why compress is ignored?

Warns that `-compress` has no effect when used together with the
expremintal `--stream` flag.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
@vdemeester vdemeester force-pushed the 1044-compress-stream-friend branch from ceabf98 to 8b3dc39 Compare June 1, 2018 16:34
@vdemeester
Copy link
Collaborator Author

Updated with erroring out 👼
cc @thaJeztah @silvin-lubecki

Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@vdemeester vdemeester merged commit d1cc8c7 into docker:master Jun 1, 2018
@GordonTheTurtle GordonTheTurtle added this to the 18.06.0 milestone Jun 1, 2018
@vdemeester vdemeester deleted the 1044-compress-stream-friend branch June 1, 2018 21:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants