Skip to content
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

Merged
merged 1 commit into from
Nov 22, 2023

Conversation

yankay
Copy link
Contributor

@yankay yankay commented Nov 21, 2023

@yankay yankay force-pushed the remove-incompatible branch 2 times, most recently from 915c3f5 to 27b72f7 Compare November 21, 2023 07:33
@yankay yankay changed the title Remove incompatible in TestComposeExecTTY Fix incompatible in TestComposeExecTTY Nov 21, 2023
@yankay yankay marked this pull request as ready for review November 21, 2023 07:40
@yankay yankay force-pushed the remove-incompatible branch 2 times, most recently from 016808c to 9f6e5f2 Compare November 21, 2023 08:16
@yankay yankay marked this pull request as draft November 21, 2023 08:21
@yankay yankay marked this pull request as ready for review November 21, 2023 08:57
@yankay yankay closed this Nov 21, 2023
@yankay yankay reopened this Nov 21, 2023
}

composeExecCommand.Flags().MarkHidden("interactive")
composeExecCommand.Flags().MarkHidden("tty")
Copy link
Member

@AkihiroSuda AkihiroSuda Nov 22, 2023

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")
Copy link
Member

@AkihiroSuda AkihiroSuda Nov 22, 2023

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.
Copy link
Member

@AkihiroSuda AkihiroSuda Nov 22, 2023

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.
Copy link
Member

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

Copy link
Contributor Author

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")
Copy link
Member

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

Copy link
Contributor Author

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 :-)

Copy link
Member

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?

Copy link
Contributor Author

@yankay yankay Nov 22, 2023

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 :-)

@yankay yankay force-pushed the remove-incompatible branch 2 times, most recently from 6e29251 to afe990d Compare November 22, 2023 04:22
@AkihiroSuda AkihiroSuda added this to the v1.7.1 (tentative) milestone Nov 22, 2023
Copy link
Member

@AkihiroSuda AkihiroSuda left a comment

Choose a reason for hiding this comment

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

Thanks

@AkihiroSuda AkihiroSuda merged commit 6318228 into containerd:main Nov 22, 2023
22 checks passed
Signed-off-by: Kay Yan <kay.yan@daocloud.io>
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.

TestComposeExecTTY has to be compatible with Docker
2 participants