summaryrefslogtreecommitdiff
path: root/libpod/options.go
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2018-01-12 12:01:34 -0500
committerGitHub <noreply@github.com>2018-01-12 12:01:34 -0500
commit6e8100cf2e70c8c6b5a8504298d1e295a288a0b1 (patch)
treedf3124bb1235b71a0e09b8f6009f1a3bce48f039 /libpod/options.go
parent198c91c2ea0c82d0ffc82eba86c31224c69e84bb (diff)
parent04e0687da14070ea3ff208687d4f749d5dc319a0 (diff)
downloadpodman-6e8100cf2e70c8c6b5a8504298d1e295a288a0b1.tar.gz
podman-6e8100cf2e70c8c6b5a8504298d1e295a288a0b1.tar.bz2
podman-6e8100cf2e70c8c6b5a8504298d1e295a288a0b1.zip
Merge pull request #211 from mheon/wireup_backends
Wire up API for CGroup Parent
Diffstat (limited to 'libpod/options.go')
-rw-r--r--libpod/options.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/libpod/options.go b/libpod/options.go
index 8097f3a64..1429f16c3 100644
--- a/libpod/options.go
+++ b/libpod/options.go
@@ -477,6 +477,23 @@ func WithNetNS(portMappings []ocicni.PortMapping) CtrCreateOption {
}
}
+// WithCgroupParent sets the Cgroup Parent of the new container
+func WithCgroupParent(parent string) CtrCreateOption {
+ return func(ctr *Container) error {
+ if ctr.valid {
+ return ErrCtrFinalized
+ }
+
+ if parent == "" {
+ return errors.Wrapf(ErrInvalidArg, "cgroup parent cannot be empty")
+ }
+
+ ctr.config.CgroupParent = parent
+
+ return nil
+ }
+}
+
// Pod Creation Options
// WithPodName sets the name of the pod