-
Notifications
You must be signed in to change notification settings - Fork 611
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
Fix incompatible in TestComposeExecTTY
#2650
Conversation
915c3f5
to
27b72f7
Compare
TestComposeExecTTY
TestComposeExecTTY
016808c
to
9f6e5f2
Compare
} | ||
|
||
composeExecCommand.Flags().MarkHidden("interactive") | ||
composeExecCommand.Flags().MarkHidden("tty") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess we can just remove --tty
return nil | ||
} | ||
|
||
composeExecCommand.Flags().MarkHidden("interactive") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't seem to exist in Docker Compose, so we can just remove it
@@ -165,7 +165,6 @@ services: | |||
func TestComposeExecTTY(t *testing.T) { | |||
// `-i` in `compose run & exec` is only supported in compose v2. | |||
// Currently CI is using compose v1. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Docker Compose v2 doesn't seem to have -i
@@ -165,7 +165,6 @@ services: | |||
func TestComposeExecTTY(t *testing.T) { | |||
// `-i` in `compose run & exec` is only supported in compose v2. | |||
// Currently CI is using compose v1. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
" Currently CI is using compose v1" is no longer true
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks , it has changed. :-)
@@ -69,7 +60,7 @@ func composeExecAction(cmd *cobra.Command, args []string) error { | |||
if err != nil { | |||
return err | |||
} | |||
tty, err := cmd.Flags().GetBool("tty") | |||
noTty, err := cmd.Flags().GetBool("no-TTY") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we still check --tty
too?
It is hidden in Docker Compose v2, but it still exists
https://github.com/docker/compose/blob/b1a26dac1d3dc201d0d026cc16cb9baadaacffd7/cmd/compose/exec.go#L77
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
HI @AkihiroSuda
Thanks for the PR review.
When using docker compose exec -t=true --no-TTY
, the docker do not check the --tty
.
root@kay200:/tmp# docker compose -f a.yaml exec --tty=true --no-TTY svc0 stty
stty: standard input: Not a tty
So it be removed to keep compatibility :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👀 Could you add a code comment to explain that behavior?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
The comments has been on it :-)
6e29251
to
afe990d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
Signed-off-by: Kay Yan <kay.yan@daocloud.io>
fix: #2639
using similar code in https://github.com/docker/compose/blob/v2.23.1/cmd/compose/exec.go#L77