Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cli: pass dockerCLI's in/out/err to cobra cmds #3971

Merged
merged 1 commit into from
Jan 17, 2023

Conversation

thaJeztah
Copy link
Member

Both the DockerCLI and Cobra Commands provide accessors for Input, Output, and Error streams (usually STDIN, STDOUT, STDERR). While we were already passing DockerCLI's Output to Cobra, we were not doing so for the other streams (and were passing none for plugin commands), potentially resulting in DockerCLI output/input to mean something else than a Cobra Command's intput/output/error.

This patch sets them to the same streams when constructing the Cobra command.

- Description for the changelog

- A picture of a cute animal (not mandatory but encouraged)

Both the DockerCLI and Cobra Commands provide accessors for Input, Output,
and Error streams (usually STDIN, STDOUT, STDERR). While we were already
passing DockerCLI's Output to Cobra, we were not doing so for the other
streams (and were passing none for plugin commands), potentially resulting
in DockerCLI output/input to mean something else than a Cobra Command's
intput/output/error.

This patch sets them to the same streams when constructing the Cobra
command.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Copy link
Collaborator

@vvoland vvoland left a comment

Choose a reason for hiding this comment

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

LGTM

@thaJeztah
Copy link
Member Author

Thx! Bringing this one in 👍

@thaJeztah thaJeztah merged commit 8627a6d into docker:master Jan 17, 2023
@thaJeztah thaJeztah deleted the sync_cobra_streams branch January 17, 2023 16:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/refactor PR's that refactor, or clean-up code status/2-code-review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants