From 116d0153f52c9a8eb0825cecccc40ea440abe674 Mon Sep 17 00:00:00 2001 From: Justin Chadwell Date: Tue, 7 Nov 2023 11:16:51 +0000 Subject: [PATCH] chore: update getTaskOpts to return multiple opts Signed-off-by: Justin Chadwell --- executor/containerdexecutor/executor.go | 3 +-- executor/containerdexecutor/executor_unix.go | 4 ++-- executor/containerdexecutor/executor_windows.go | 4 ++-- 3 files changed, 5 insertions(+), 6 deletions(-) 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) {