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

Implement nerdctl compose exec -T #2507

Merged
merged 1 commit into from
Sep 16, 2023

Conversation

AkihiroSuda
Copy link
Member

@AkihiroSuda AkihiroSuda commented Sep 15, 2023

This flag just equates to docker compose exec -T:

Disable pseudo-TTY allocation. By default docker compose exec allocates a TTY.

Needed by:

composeExecCommand.Flags().Bool("privileged", false, "Give extended privileges to the command")
composeExecCommand.Flags().StringP("user", "u", "", "Username or UID (format: <name|uid>[:<group|gid>])")
composeExecCommand.Flags().Int("index", 1, "index of the container if the service has multiple instances.")

composeExecCommand.PreRunE = func(cmd *cobra.Command, args []string) error {
flags := cmd.Flags()
if noTTY, _ := flags.GetBool("no-TTY"); noTTY {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if noTTY, _ := flags.GetBool("no-TTY"); noTTY {
if noTTY, err := flags.GetBool("no-TTY"); err == nil && noTTY {

Copy link
Member Author

Choose a reason for hiding this comment

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

Doesn't seem necessary. When err != nil, noTTY is unlikely to be true.

@fahedouch
Copy link
Member

fahedouch commented Sep 16, 2023

could you please add more context in the PR description

@AkihiroSuda
Copy link
Member Author

could you please add more context in the PR description

This flag just equates to docker compose exec -T:

Disable pseudo-TTY allocation. By default docker compose exec allocates a TTY.

Copy link
Member

@fahedouch fahedouch 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 5d07576 into containerd:main Sep 16, 2023
21 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.

2 participants