Skip to content

Commit 51a604c

Browse files
committed
cri: add deprecation warning for runtime_root
Signed-off-by: Samuel Karp <[email protected]>
1 parent 8040e74 commit 51a604c

3 files changed

Lines changed: 6 additions & 0 deletions

File tree

pkg/cri/config/config.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,7 @@ func ValidatePluginConfig(ctx context.Context, c *PluginConfig) ([]deprecation.W
480480
if r.Type != plugin.RuntimeLinuxV1 {
481481
return warnings, fmt.Errorf("`runtime_root` only works for runtime %s", plugin.RuntimeLinuxV1)
482482
}
483+
warnings = append(warnings, deprecation.CRIRuntimeRoot)
483484
log.G(ctx).Warning("`runtime_root` is deprecated, please use runtime `options` instead")
484485
}
485486
if !r.PrivilegedWithoutHostDevices && r.PrivilegedWithoutHostDevicesAllDevicesAllowed {

pkg/cri/config/config_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,7 @@ func TestValidateConfig(t *testing.T) {
267267
},
268268
},
269269
},
270+
warnings: []deprecation.Warning{deprecation.CRIRuntimeRoot},
270271
},
271272
"deprecated runtime_root for v2 runtime": {
272273
config: &PluginConfig{

pkg/deprecation/deprecation.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ const (
3333
CRIDefaultRuntime Warning = Prefix + "cri-default-runtime"
3434
// CRIRuntimeEngine is a warning for the `runtime_engine` property
3535
CRIRuntimeEngine Warning = Prefix + "cri-runtime-engine"
36+
// CRIRuntimeRoot is a warning for the `runtime_root` property
37+
CRIRuntimeRoot Warning = Prefix + "cri-runtime-root"
3638
// CRIRegistryMirrors is a warning for the use of the `mirrors` property
3739
CRIRegistryMirrors Warning = Prefix + "cri-registry-mirrors"
3840
// CRIRegistryAuths is a warning for the use of the `auths` property
@@ -61,6 +63,8 @@ var messages = map[Warning]string{
6163
"Use `default_runtime_name` instead.",
6264
CRIRuntimeEngine: "The `runtime_engine` property of [plugins.\"io.containerd.grpc.v1.cri\".containerd.runtimes.*] is deprecated since containerd v1.3 and will be removed in containerd v2.0. " +
6365
"Use a v2 runtime and `options` instead.",
66+
CRIRuntimeRoot: "The `runtime_root` property of [plugins.\"io.containerd.grpc.v1.cri\".containerd.runtimes.*] is deprecated since containerd v1.3 and will be removed in containerd v2.0. " +
67+
"Use a v2 runtime and `options.Root` instead.",
6468
CRIRegistryMirrors: "The `mirrors` property of `[plugins.\"io.containerd.grpc.v1.cri\".registry]` is deprecated since containerd v1.5 and will be removed in containerd v2.0." +
6569
"Use `config_path` instead.",
6670
CRIRegistryAuths: "The `auths` property of `[plugins.\"io.containerd.grpc.v1.cri\".registry]` is deprecated since containerd v1.3 and will be removed in containerd v2.0." +

0 commit comments

Comments
 (0)