Skip to content

Fix flag -t needs -i to be specified together restriction in compose run #1604

@djdongjin

Description

@djdongjin

What is the problem you're trying to solve

Previously -i and -t cannot be specified together in nerdctl exec/run, which was fixed in 18ea81f. We should be able to remove the restriction in nerdctl compose run as well.

This can be a good first issue.

Describe the solution you'd like

nerdctl compose run can use -i, -t independently. Some places to look into:

https://github.com/containerd/nerdctl/blob/main/cmd/nerdctl/run.go#L101 (update -t usage document)

https://github.com/containerd/nerdctl/blob/main/cmd/nerdctl/compose_run.go#L119 (update -t usage and use the cli value)

https://github.com/containerd/nerdctl/blob/main/pkg/composer/run.go (make sure -i, -t are used correctly)

https://github.com/containerd/nerdctl/blob/main/pkg/composer/up_service.go#L160 (remove the restriction)

Also add integration test for compose run similar to the tests in the above commit.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions