diff --git a/executor/containerdexecutor/executor.go b/executor/containerdexecutor/executor.go index 5c1b77778..ec1e97625 100644 --- a/executor/containerdexecutor/executor.go +++ b/executor/containerdexecutor/executor.go @@ -179,8 +179,7 @@ func (w *containerdExecutor) Run(ctx context.Context, id string, root executor.M if err != nil { return nil, err } - - task, err := container.NewTask(ctx, cio.NewCreator(cioOpts...), taskOpts) + task, err := container.NewTask(ctx, cio.NewCreator(cioOpts...), taskOpts...) if err != nil { return nil, err } diff --git a/executor/containerdexecutor/executor_unix.go b/executor/containerdexecutor/executor_unix.go index 0018360b7..4e8234a25 100644 --- a/executor/containerdexecutor/executor_unix.go +++ b/executor/containerdexecutor/executor_unix.go @@ -161,7 +161,7 @@ func (w *containerdExecutor) createOCISpec(ctx context.Context, id, resolvConf, return spec, releaseAll, nil } -func (d *containerState) getTaskOpts() (containerd.NewTaskOpts, error) { +func (d *containerState) getTaskOpts() ([]containerd.NewTaskOpts, error) { rootfs := containerd.WithRootFS([]mount.Mount{{ Source: d.rootfsPath, Type: "bind", @@ -174,7 +174,7 @@ func (d *containerState) getTaskOpts() (containerd.NewTaskOpts, error) { Options: []string{}, }}) } - return rootfs, nil + return []containerd.NewTaskOpts{rootfs}, nil } func setArgs(spec *specs.Process, args []string) { diff --git a/executor/containerdexecutor/executor_windows.go b/executor/containerdexecutor/executor_windows.go index 5bb4e1237..26712a681 100644 --- a/executor/containerdexecutor/executor_windows.go +++ b/executor/containerdexecutor/executor_windows.go @@ -96,8 +96,8 @@ func (w *containerdExecutor) createOCISpec(ctx context.Context, id, resolvConf, return spec, releaseAll, nil } -func (d *containerState) getTaskOpts() (containerd.NewTaskOpts, error) { - return containerd.WithRootFS(d.rootMounts), nil +func (d *containerState) getTaskOpts() ([]containerd.NewTaskOpts, error) { + return []containerd.NewTaskOpts{containerd.WithRootFS(d.rootMounts)}, nil } func setArgs(spec *specs.Process, args []string) {