From 9074565f4e623124f17ce02657e35d658abafae5 Mon Sep 17 00:00:00 2001 From: Jhon Honce Date: Tue, 25 Sep 2018 10:09:16 -0700 Subject: Implement pod varlink bindings * Update varlink document * Add NoContainersInPod error in go and python * Add support for varlink pod interface * New code passes pylint * Fix bug in test_runner.sh * Update integration tests for race condition on status check * Add missing port config file support Signed-off-by: Jhon Honce --- pkg/varlinkapi/pods.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'pkg/varlinkapi/pods.go') 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 { -- cgit v1.2.3-54-g00ecf