From 77baae25ce473cac57d107715bebdf914f2567a0 Mon Sep 17 00:00:00 2001 From: haircommander Date: Tue, 14 Aug 2018 14:37:01 -0400 Subject: Updated pod_api to reflect function spec Specifically, pod.Start() always returned CtrErrors, even if none failed. This cause podman start to not return the successfully started pod id. Also, pod.Kill() didn't return an error along with ctrErrors. Signed-off-by: haircommander Closes: #1272 Approved by: rhatdan --- libpod/pod_api.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libpod/pod_api.go b/libpod/pod_api.go index 82cf7b727..d1e19063c 100644 --- a/libpod/pod_api.go +++ b/libpod/pod_api.go @@ -55,7 +55,11 @@ func (p *Pod) Start(ctx context.Context) (map[string]error, error) { startNode(ctx, node, false, ctrErrors, ctrsVisited, false) } - return ctrErrors, nil + if len(ctrErrors) > 0 { + return ctrErrors, errors.Wrapf(ErrCtrExists, "error starting some containers") + } + + return nil, nil } // Stop stops all containers within a pod that are not already stopped @@ -352,7 +356,7 @@ func (p *Pod) Kill(signal uint) (map[string]error, error) { } if len(ctrErrors) > 0 { - return ctrErrors, nil + return ctrErrors, errors.Wrapf(ErrCtrExists, "error killing some containers") } return nil, nil -- cgit v1.2.3-54-g00ecf