chore: update getTaskOpts to return multiple opts

Signed-off-by: Justin Chadwell <me@jedevc.com>
This commit is contained in:
Justin Chadwell
2023-11-07 11:16:51 +00:00
parent 25e9aa8d39
commit 116d0153f5
3 changed files with 5 additions and 6 deletions

View File

@@ -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
}

View File

@@ -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) {

View File

@@ -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) {