diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2018-10-02 08:47:53 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-02 08:47:53 -0700 |
commit | 89c5804fe0ca3ece7587adb5d5c974dbc494f721 (patch) | |
tree | 042a10e85f659e8ce3d8ab1841752392e53b353d /pkg | |
parent | 08898cb5ac982c9f160e50731616a5ca27e56a09 (diff) | |
parent | ff38edaafefa1cdac9a87a1a08b8f4fcd94ae996 (diff) | |
download | podman-89c5804fe0ca3ece7587adb5d5c974dbc494f721.tar.gz podman-89c5804fe0ca3ece7587adb5d5c974dbc494f721.tar.bz2 podman-89c5804fe0ca3ece7587adb5d5c974dbc494f721.zip |
Merge pull request #1563 from jwhonce/wip/pods
Implement pod varlink bindings
Diffstat (limited to 'pkg')
-rw-r--r-- | pkg/varlinkapi/pods.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/pkg/varlinkapi/pods.go b/pkg/varlinkapi/pods.go index d95b631f2..8b72492b0 100644 --- a/pkg/varlinkapi/pods.go +++ b/pkg/varlinkapi/pods.go @@ -104,6 +104,13 @@ func (i *LibpodAPI) StartPod(call iopodman.VarlinkCall, name string) error { if err != nil { return call.ReplyPodNotFound(name) } + ctnrs, err := pod.AllContainers() + if err != nil { + return call.ReplyErrorOccurred(err.Error()) + } + if 0 == len(ctnrs) { + return call.ReplyNoContainersInPod(name) + } ctrErrs, err := pod.Start(getContext()) callErr := handlePodCall(call, pod, ctrErrs, err) if callErr != nil { @@ -132,6 +139,13 @@ func (i *LibpodAPI) RestartPod(call iopodman.VarlinkCall, name string) error { if err != nil { return call.ReplyPodNotFound(name) } + ctnrs, err := pod.AllContainers() + if err != nil { + return call.ReplyErrorOccurred(err.Error()) + } + if 0 == len(ctnrs) { + return call.ReplyNoContainersInPod(name) + } ctrErrs, err := pod.Restart(getContext()) callErr := handlePodCall(call, pod, ctrErrs, err) if callErr != nil { |