@@ -64,6 +64,13 @@ type ContainerdConfig struct {
6464 Snapshotter string `toml:"snapshotter" json:"snapshotter"`
6565 // DefaultRuntimeName is the default runtime name to use from the runtimes table.
6666 DefaultRuntimeName string `toml:"default_runtime_name" json:"defaultRuntimeName"`
67+ // DefaultRuntime is the default runtime to use in containerd.
68+ // This runtime is used when no runtime handler (or the empty string) is provided.
69+ // DEPRECATED: use DefaultRuntimeName instead. Remove in containerd 1.4.
70+ DefaultRuntime Runtime `toml:"default_runtime" json:"defaultRuntime"`
71+ // UntrustedWorkloadRuntime is a runtime to run untrusted workloads on it.
72+ // DEPRECATED: use `untrusted` runtime in Runtimes instead. Remove in containerd 1.4.
73+ UntrustedWorkloadRuntime Runtime `toml:"untrusted_workload_runtime" json:"untrustedWorkloadRuntime"`
6774 // Runtimes is a map from CRI RuntimeHandler strings, which specify types of runtime
6875 // configurations, to the matching configurations.
6976 Runtimes map [string ]Runtime `toml:"runtimes" json:"runtimes"`
@@ -300,6 +307,22 @@ func ValidatePluginConfig(ctx context.Context, c *PluginConfig) error {
300307 c .ContainerdConfig .Runtimes = make (map [string ]Runtime )
301308 }
302309
310+ // Validation for deprecated untrusted_workload_runtime.
311+ if c .ContainerdConfig .UntrustedWorkloadRuntime .Type != "" {
312+ log .G (ctx ).Warning ("`untrusted_workload_runtime` is deprecated, please use `untrusted` runtime in `runtimes` instead" )
313+ if _ , ok := c .ContainerdConfig .Runtimes [RuntimeUntrusted ]; ok {
314+ return errors .Errorf ("conflicting definitions: configuration includes both `untrusted_workload_runtime` and `runtimes[%q]`" , RuntimeUntrusted )
315+ }
316+ c .ContainerdConfig .Runtimes [RuntimeUntrusted ] = c .ContainerdConfig .UntrustedWorkloadRuntime
317+ }
318+
319+ // Validation for deprecated default_runtime field.
320+ if c .ContainerdConfig .DefaultRuntime .Type != "" {
321+ log .G (ctx ).Warning ("`default_runtime` is deprecated, please use `default_runtime_name` to reference the default configuration you have defined in `runtimes`" )
322+ c .ContainerdConfig .DefaultRuntimeName = RuntimeDefault
323+ c .ContainerdConfig .Runtimes [RuntimeDefault ] = c .ContainerdConfig .DefaultRuntime
324+ }
325+
303326 // Validation for default_runtime_name
304327 if c .ContainerdConfig .DefaultRuntimeName == "" {
305328 return errors .New ("`default_runtime_name` is empty" )
0 commit comments