containerd/pkg/opts/task.go
Abhinandan Prativadi 59008c608e Setting containerd shim cgroup same as pod cgroup
Signed-off-by: Abhinandan Prativadi <abhi@docker.com>
2017-08-31 15:16:51 -07:00

23 lines
574 B
Go

package opts
import (
"context"
"github.com/containerd/containerd"
"github.com/containerd/containerd/linux/runcopts"
)
// 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 = &runcopts.CreateOptions{
ShimCgroup: path,
}
return nil
}
}
//TODO: Since Options is an interface different WithXXX will be needed to set different
// combinations of CreateOptions.