diff options
author | zhangguanzhang <zhangguanzhang@qq.com> | 2020-08-01 23:37:41 +0800 |
---|---|---|
committer | Valentin Rothberg <rothberg@redhat.com> | 2020-08-11 12:15:24 +0200 |
commit | 85d7cb5fd42642b26b0fe3c98f165c081b41c45e (patch) | |
tree | 463a6f3a72500090ab9b800f75f08bc948621ecc /cmd | |
parent | d6442f5f571112d66fd62309a2e8e15c163ff4f3 (diff) | |
download | podman-85d7cb5fd42642b26b0fe3c98f165c081b41c45e.tar.gz podman-85d7cb5fd42642b26b0fe3c98f165c081b41c45e.tar.bz2 podman-85d7cb5fd42642b26b0fe3c98f165c081b41c45e.zip |
implement the exitcode when start a container with attach
Signed-off-by: zhangguanzhang <zhangguanzhang@qq.com>
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/podman/containers/start.go | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/cmd/podman/containers/start.go b/cmd/podman/containers/start.go index 8f9984421..84a7aa4e2 100644 --- a/cmd/podman/containers/start.go +++ b/cmd/podman/containers/start.go @@ -99,12 +99,17 @@ func start(cmd *cobra.Command, args []string) error { } for _, r := range responses { - if r.Err == nil && !startOptions.Attach { - fmt.Println(r.RawInput) + if r.Err == nil { + if startOptions.Attach { + // Implement the exitcode when the only one container is enabled attach + registry.SetExitCode(r.ExitCode) + } else { + fmt.Println(r.RawInput) + } } else { errs = append(errs, r.Err) } } - // TODO need to understand an implement exitcodes + return errs.PrintErrors() } |