Setting containerd shim cgroup same as pod cgroup

Signed-off-by: abhi <abhi@docker.com>
This commit is contained in:
abhi
2017-11-30 16:26:01 -08:00
parent 0db6e04ba1
commit 0d6774f4af
3 changed files with 35 additions and 3 deletions

22
pkg/opts/task.go Normal file
View File

@@ -0,0 +1,22 @@
package opts
import (
"context"
"github.com/containerd/containerd"
"github.com/containerd/containerd/linux/runctypes"
)
// WithContainerdShimCgroup returns function that sets the containerd
// shim cgroup path
func WithContainerdShimCgroup(path string) containerd.NewTaskOpts {
return func(_ context.Context, _ *containerd.Client, r *containerd.TaskInfo) error {
r.Options = &runctypes.CreateOptions{
ShimCgroup: path,
}
return nil
}
}
//TODO: Since Options is an interface different WithXXX will be needed to set different
// combinations of CreateOptions.