Skip to content

cmd/docker: Allow interactive cloud context resolution - #7356

Merged
thaJeztah merged 2 commits into
docker:masterfrom
nicksieger:cloud-resolver-interactive-input
Oct 5, 2026
Merged

thaJeztah merged 2 commits into
docker:masterfrom
nicksieger:cloud-resolver-interactive-input

Conversation

@nicksieger

@nicksieger nicksieger commented Oct 5, 2026 •

Copy link
Copy Markdown
Member

Replaces #7354, which was opened from a fork branch that I cannot update. This PR carries the same change plus a follow-up commit that fixes the gocyclo lint failure on resolveCloudContext.

Follow up to #7343.

Summary

Allow --cloud context 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.

resolveCloudContext is split into setResolverStdio and validateResolvedContext to bring its cyclomatic complexity under the lint limit. Behavior is unchanged.

🤖 Generated with Claude Code

nico1510 and others added 2 commits October 5, 2026 19:59
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>
- extract setResolverStdio for resolver terminal wiring
- extract validateResolvedContext for context/endpoint checks

Signed-off-by: Nick Sieger <nick@nicksieger.com>
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 75.00000% with 6 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
cmd/docker/cloud.go 75.00% 5 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@thaJeztah thaJeztah left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM (assuming CI is happy once GitHub is no longer AWOL)

@thaJeztah thaJeztah closed this Oct 5, 2026
@thaJeztah thaJeztah reopened this Oct 5, 2026

@docker-agent docker-agent left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Assessment: 🟢 APPROVE

@thaJeztah

Copy link
Copy Markdown
Member

FWIW; this test failure is unrelated, and can be ignored;

=== FAIL: e2e/container TestRunAttachedFromRemoteImageAndRemove (0.48s)
    run_test.go:42: assertion failed: 
        --- expected
        +++ actual
        @@ -1,4 +1,5 @@
         Unable to find image 'registry:5000/alpine:test-run-pulls' locally
         test-run-pulls: Pulling from alpine
        +63b65145d645: Pulling fs layer
         Digest: sha256:e2e16842c9b54d985bf1ef9242a313f36b856181f188de21313820e177002501
         Status: Downloaded newer image for registry:5000/alpine:test-run-pulls

@thaJeztah
thaJeztah merged commit 5e6d8e3 into docker:master Oct 5, 2026
161 of 200 checks passed
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.

5 participants