sandbox: change SandboxMode to Sandboxer
Signed-off-by: Abel Feng <fshb1988@gmail.com>
This commit is contained in:
@@ -74,11 +74,11 @@ type Runtime struct {
|
||||
// while using default snapshotters for operational simplicity.
|
||||
// See https://github.com/containerd/containerd/issues/6657 for details.
|
||||
Snapshotter string `toml:"snapshotter" json:"snapshotter"`
|
||||
// SandboxMode defines which sandbox runtime to use when scheduling pods
|
||||
// Sandboxer defines which sandbox runtime to use when scheduling pods
|
||||
// This features requires the new CRI server implementation (enabled by default in 2.0)
|
||||
// shim - means use whatever Controller implementation provided by shim (e.g. use RemoteController).
|
||||
// podsandbox - means use Controller implementation from sbserver podsandbox package.
|
||||
SandboxMode string `toml:"sandbox_mode" json:"sandboxMode"`
|
||||
Sandboxer string `toml:"sandboxer" json:"sandboxer"`
|
||||
}
|
||||
|
||||
// ContainerdConfig contains toml config related to containerd
|
||||
@@ -383,8 +383,8 @@ func ValidatePluginConfig(ctx context.Context, c *PluginConfig) error {
|
||||
return errors.New("`privileged_without_host_devices_all_devices_allowed` requires `privileged_without_host_devices` to be enabled")
|
||||
}
|
||||
// If empty, use default podSandbox mode
|
||||
if len(r.SandboxMode) == 0 {
|
||||
r.SandboxMode = string(ModePodSandbox)
|
||||
if len(r.Sandboxer) == 0 {
|
||||
r.Sandboxer = string(ModePodSandbox)
|
||||
c.ContainerdConfig.Runtimes[k] = r
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ func TestValidateConfig(t *testing.T) {
|
||||
DefaultRuntimeName: RuntimeDefault,
|
||||
Runtimes: map[string]Runtime{
|
||||
RuntimeDefault: {
|
||||
SandboxMode: string(ModePodSandbox),
|
||||
Sandboxer: string(ModePodSandbox),
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@@ -69,9 +69,9 @@ func DefaultConfig() PluginConfig {
|
||||
DefaultRuntimeName: "runc",
|
||||
Runtimes: map[string]Runtime{
|
||||
"runc": {
|
||||
Type: "io.containerd.runc.v2",
|
||||
Options: m,
|
||||
SandboxMode: string(ModePodSandbox),
|
||||
Type: "io.containerd.runc.v2",
|
||||
Options: m,
|
||||
Sandboxer: string(ModePodSandbox),
|
||||
},
|
||||
},
|
||||
DisableSnapshotAnnotations: true,
|
||||
|
||||
Reference in New Issue
Block a user