Files
containerd/pkg/opts/task.go
2017-12-01 08:33:50 -08:00

23 lines
576 B
Go

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.