fix: allow -t flag to be used independently in compose run - #5149
Open
wryyyds7 wants to merge 1 commit into
Open
fix: allow -t flag to be used independently in compose run#5149wryyyds7 wants to merge 1 commit into
wryyyds7 wants to merge 1 commit into
Conversation
wryyyds7
force-pushed
the
fix/compose-run-t-flag
branch
2 times, most recently
from
August 25, 2026 03:29
95ff242 to
b558f87
Compare
Previously, -t (tty) was not available as a standalone flag in 'nerdctl compose run' — it was hardcoded to follow -i (interactive). This meant users could not allocate a TTY without also enabling STDIN, and any use of -t or --tty would result in 'unknown flag'. This change: - Adds a standalone -t/--tty flag to 'compose run' - For backward compatibility, when -t is not explicitly set, it follows -i (preserving existing behavior) - Removes the restriction that StdinOpen and Tty must be equal in up_service.go AND create.go - Allows -i and -t to be specified independently Ref: containerd#1604 Signed-off-by: wryyyds7 <2414898121@qq.com>
wryyyds7
force-pushed
the
fix/compose-run-t-flag
branch
from
August 25, 2026 07:08
b558f87 to
9b77ad9
Compare
Author
CI Status UpdateThe compose-related test failures from the previous CI run have been fixed. The fix adds backward compatibility: when Compose tests: all passing ✅
Remaining CI failures: known flaky tests (unrelated to this PR)The 4 remaining failing jobs are all known flaky tests:
These failures also appear on other merged PRs (e.g., #5130 has the same No code changes are needed for these flaky tests. |
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.
What this PR does
Previously,
-t(tty) was not available as a standalone flag innerdctl compose run— it was hardcoded to follow-i(interactive). This meant users could not allocate a TTY without also enabling STDIN, and any use of-tor--ttywould result inunknown flagerror.This PR:
-t/--ttyflag tocompose runStdinOpenandTtymust be equal inup_service.go-iand-tto be specified independentlyChanges
cmd/nerdctl/compose/compose_run.go: Added-t/--ttyflag, changedttyfrom= interactiveto independentcmd.Flags().GetBool("tty")pkg/composer/up_service.go: RemovedStdinOpen != Ttyerror checkVerification
Compiled both original and modified binaries, ran 30 test cases comparing behavior:
-tbut modified version accepts itRef: #1604