aboutsummaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
authorhaircommander <pehunt@redhat.com>2018-08-16 17:12:16 -0400
committerAtomic Bot <atomic-devel@projectatomic.io>2018-08-23 18:16:28 +0000
commit697b46430a8a7c2c7231078911dcec51f0c6fab5 (patch)
tree11c42e287c8b22d9a2e47788d1427dba118d9828 /pkg
parentd5e690914dc78eca8664442e7677eb5004522bfd (diff)
downloadpodman-697b46430a8a7c2c7231078911dcec51f0c6fab5.tar.gz
podman-697b46430a8a7c2c7231078911dcec51f0c6fab5.tar.bz2
podman-697b46430a8a7c2c7231078911dcec51f0c6fab5.zip
Support pause containers in varlink
Signed-off-by: haircommander <pehunt@redhat.com> Closes: #1187 Approved by: mheon
Diffstat (limited to 'pkg')
-rw-r--r--pkg/varlinkapi/pods.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/pkg/varlinkapi/pods.go b/pkg/varlinkapi/pods.go
index 6252d815b..657aa0baf 100644
--- a/pkg/varlinkapi/pods.go
+++ b/pkg/varlinkapi/pods.go
@@ -21,6 +21,20 @@ func (i *LibpodAPI) CreatePod(call iopodman.VarlinkCall, create iopodman.PodCrea
if create.Name != "" {
options = append(options, libpod.WithPodName(create.Name))
}
+ if len(create.Share) > 0 && !create.Pause {
+ return call.ReplyErrorOccurred("You cannot share kernel namespaces on the pod level without a pause container")
+ }
+ if len(create.Share) == 0 && create.Pause {
+ return call.ReplyErrorOccurred("You must share kernel namespaces to run a pause container")
+ }
+ if create.Pause {
+ options = append(options, libpod.WithPauseContainer())
+ nsOptions, err := shared.GetNamespaceOptions(create.Share)
+ if err != nil {
+ return err
+ }
+ options = append(options, nsOptions...)
+ }
options = append(options, libpod.WithPodCgroups())
pod, err := i.Runtime.NewPod(getContext(), options...)