aboutsummaryrefslogtreecommitdiff
path: root/cmd/podman
diff options
context:
space:
mode:
authorzhangguanzhang <zhangguanzhang@qq.com>2020-08-01 23:37:41 +0800
committerzhangguanzhang <zhangguanzhang@qq.com>2020-08-03 21:40:06 +0800
commita5a0ba9cb49a5a311fb0e9245f5bc8e0a35656ba (patch)
tree1b7e705ed7518f40511f2a03eecf2ee27e64ba9e /cmd/podman
parentb4fa2c2517fd313bb0000f7697274d2ab2498265 (diff)
downloadpodman-a5a0ba9cb49a5a311fb0e9245f5bc8e0a35656ba.tar.gz
podman-a5a0ba9cb49a5a311fb0e9245f5bc8e0a35656ba.tar.bz2
podman-a5a0ba9cb49a5a311fb0e9245f5bc8e0a35656ba.zip
implement the exitcode when start a container with attach
Signed-off-by: zhangguanzhang <zhangguanzhang@qq.com>
Diffstat (limited to 'cmd/podman')
-rw-r--r--cmd/podman/containers/start.go11
1 files changed, 8 insertions, 3 deletions
diff --git a/cmd/podman/containers/start.go b/cmd/podman/containers/start.go
index 05fdfc780..ccbe80317 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()
}