mirror of
https://github.com/containers/podman.git
synced 2025-10-25 02:04:43 +08:00
Merge pull request #1563 from jwhonce/wip/pods
Implement pod varlink bindings
This commit is contained in:
@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user