Support runtime specific configurations.
Signed-off-by: Lantao Liu <lantaol@google.com>
This commit is contained in:
@@ -108,8 +108,14 @@ func (c *criService) startContainer(ctx context.Context,
|
||||
return cntr.IO, nil
|
||||
}
|
||||
|
||||
ctrInfo, err := container.Info(ctx)
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "failed to get container info")
|
||||
}
|
||||
|
||||
var taskOpts []containerd.NewTaskOpts
|
||||
if c.config.NoPivot {
|
||||
// TODO(random-liu): Remove this after shim v1 is deprecated.
|
||||
if c.config.NoPivot && ctrInfo.Runtime.Name == linuxRuntime {
|
||||
taskOpts = append(taskOpts, containerd.WithNoPivotRoot)
|
||||
}
|
||||
task, err := container.NewTask(ctx, ioCreation, taskOpts...)
|
||||
|
Reference in New Issue
Block a user