summaryrefslogtreecommitdiff
path: root/libpod/options.go
diff options
context:
space:
mode:
Diffstat (limited to 'libpod/options.go')
-rw-r--r--libpod/options.go29
1 files changed, 29 insertions, 0 deletions
diff --git a/libpod/options.go b/libpod/options.go
index 1af788e46..34bde3211 100644
--- a/libpod/options.go
+++ b/libpod/options.go
@@ -944,3 +944,32 @@ func WithPodLabels(labels map[string]string) PodCreateOption {
return nil
}
}
+
+// WithPodCgroupParent sets the Cgroup Parent of the pod.
+func WithPodCgroupParent(path string) PodCreateOption {
+ return func(pod *Pod) error {
+ if pod.valid {
+ return ErrPodFinalized
+ }
+
+ pod.config.CgroupParent = path
+
+ return nil
+ }
+}
+
+// WithPodCgroups tells containers in this pod to use the cgroup created for
+// this pod.
+// This can still be overridden at the container level by explicitly specifying
+// a CGroup parent.
+func WithPodCgroups() PodCreateOption {
+ return func(pod *Pod) error {
+ if pod.valid {
+ return ErrPodFinalized
+ }
+
+ pod.config.UsePodCgroup = true
+
+ return nil
+ }
+}