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
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' - Removes the restriction that StdinOpen and Tty must be equal - Allows -i and -t to be specified independently Ref: containerd#1604 Signed-off-by: wryyyds7 <wry@code.alipay.com>
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