aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhaircommander <pehunt@redhat.com>2018-08-14 14:37:01 -0400
committerAtomic Bot <atomic-devel@projectatomic.io>2018-08-14 21:49:33 +0000
commit77baae25ce473cac57d107715bebdf914f2567a0 (patch)
tree8f04fb59080eb9a98ef9012e3607c22e09767186
parent3445abd89d9c788f0edeb609ec9f470a42ff926e (diff)
downloadpodman-77baae25ce473cac57d107715bebdf914f2567a0.tar.gz
podman-77baae25ce473cac57d107715bebdf914f2567a0.tar.bz2
podman-77baae25ce473cac57d107715bebdf914f2567a0.zip
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 <pehunt@redhat.com> Closes: #1272 Approved by: rhatdan
-rw-r--r--libpod/pod_api.go8
1 files 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