Merge pull request #1563 from jwhonce/wip/pods

Implement pod varlink bindings
This commit is contained in:
OpenShift Merge Robot
2018-10-02 08:47:53 -07:00
committed by GitHub
14 changed files with 983 additions and 20 deletions

View File

@ -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 {