From 85d7cb5fd42642b26b0fe3c98f165c081b41c45e Mon Sep 17 00:00:00 2001 From: zhangguanzhang Date: Sat, 1 Aug 2020 23:37:41 +0800 Subject: implement the exitcode when start a container with attach Signed-off-by: zhangguanzhang --- cmd/podman/containers/start.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'cmd') 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() } -- cgit v1.2.3-54-g00ecf