Repository navigation
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
docker-agent
reviewed
Oct 5, 2026
docker-agent
left a comment
Contributor
There was a problem hiding this comment.
Assessment: 🟢 APPROVE
thaJeztah
reviewed
Oct 5, 2026
| // hiding terminal identity and potentially consuming the command's input. | ||
| cmd.Stdin = stdin | ||
| cmd.Stderr = stderr | ||
| } |
Member
There was a problem hiding this comment.
ISTR there were some quirks on Windows where we need to pass os.StdIn directly because term.StdStreams() can wrap the Windows console streams. In that case IsTerminal() is true but File() does not return the underlying *os.File.
I'm not on Windows to verify, but quick draft from my LLM;
stdinTerminal := dockerCli.In().IsTerminal()
stderrTerminal := dockerCli.Err().IsTerminal()
stdin, stdinFile := dockerCli.In().File()
stderr, stderrFile := dockerCli.Err().File()
// term.StdStreams may wrap the Windows console streams, in which case
// File() cannot expose the underlying *os.File. Pass the standard handles
// directly when the streams are terminals.
if runtime.GOOS == "windows" {
if stdinTerminal {
stdin, stdinFile = os.Stdin, true
}
if stderrTerminal {
stderr, stderrFile = os.Stderr, true
}
}
if stdinTerminal && stderrTerminal && stdinFile && stderrFile {
// Pass files directly: wrapping them makes os/exec copy through pipes,
// hiding terminal identity and potentially consuming the command's input.
cmd.Stdin = stdin
cmd.Stderr = stderr
}
Member
|
FWIW; this test failure is unrelated, and can be ignored; |
Forward stdin and stderr to cloud context providers when both are terminals, allowing prompts during --cloud resolution. Pass file handles directly to preserve terminal detection and leave piped or redirected input available to the requested command. Use the standard console handles when Windows terminal wrappers hide their underlying files. Keep stdout reserved for the JSON response. Signed-off-by: Nicolas Beck <nicolas.beck@docker.com>
nico1510
force-pushed
the
cloud-resolver-interactive-input
branch
from
October 5, 2026 19:59
50a5cad to
488292c
Compare
Member
|
merged through #7356 |
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.
Follow up to #7343.
Summary
Allow
--cloudcontext providers to prompt during interactive resolution by forwarding stdin and stderr when both are terminals. Stdout remains reserved for the JSON response.Pass terminal files directly to preserve terminal detection and avoid intermediary input buffering. On Windows, use the corresponding standard console handles when terminal wrappers do not expose their underlying files. Piped or redirected stdin remains available to the requested command.
Existing tests cover interactive input, piped and redirected stdin, redirected stderr, and noninteractive execution.
go test ./cmd/docker, lint for the changed code, and cross-compilation for Windows amd64 pass.The full unit suite previously had one failure,
TestNodeAddrOptionSetHostOnlyIPv6, with Go 1.26.0. The same failure reproduces on unmodifiedmaster.