Skip to content

Commit

Permalink
The podman start --attach command should not print ID
Browse files Browse the repository at this point in the history
Somewhere in the Podman v2 rewrite, we allowed
`podman start --attach` to print the container ID of the started
container after exiting from the attach session (via detach key
or the container exiting naturally). We should never print the ID
when `--attach` is given, which makes the fix simple - make the
print statement conditional on `--attach` not being present.

Wierdly, this only happened with `--interactive` was given to
`podman start`. I don't know why that is, but this resolves the
issue without having to dig any deeper, so I'm content.

Fixes #7055

Signed-off-by: Matthew Heon <[email protected]>
  • Loading branch information
mheon committed Jul 23, 2020
1 parent 80add29 commit 099649a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/podman/containers/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ func start(cmd *cobra.Command, args []string) error {
}

for _, r := range responses {
if r.Err == nil {
if r.Err == nil && !startOptions.Attach {
fmt.Println(r.RawInput)
} else {
errs = append(errs, r.Err)
Expand Down

0 comments on commit 099649a

Please sign in to comment.