Skip to content

Commit afef7ec

Browse files
committed
cri: add warning for untrusted_workload_runtime
Signed-off-by: Samuel Karp <[email protected]>
1 parent 6220dc1 commit afef7ec

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
@@ -433,6 +433,7 @@ func ValidatePluginConfig(ctx context.Context, c *PluginConfig) ([]deprecation.W
433433
if _, ok := c.ContainerdConfig.Runtimes[RuntimeUntrusted]; ok {
434434
return warnings, fmt.Errorf("conflicting definitions: configuration includes both `untrusted_workload_runtime` and `runtimes[%q]`", RuntimeUntrusted)
435435
}
436+
warnings = append(warnings, deprecation.CRIUntrustedWorkloadRuntime)
436437
c.ContainerdConfig.Runtimes[RuntimeUntrusted] = c.ContainerdConfig.UntrustedWorkloadRuntime
437438
}
438439

pkg/cri/config/config_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ func TestValidateConfig(t *testing.T) {
6767
},
6868
},
6969
},
70+
warnings: []deprecation.Warning{deprecation.CRIUntrustedWorkloadRuntime},
7071
},
7172
"both untrusted_workload_runtime and runtime[untrusted]": {
7273
config: &PluginConfig{

pkg/deprecation/deprecation.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ const (
2727
GoPluginLibrary Warning = Prefix + "go-plugin-library"
2828
// CRISystemdCgroupV1 is a warning for the `systemd_cgroup` property
2929
CRISystemdCgroupV1 Warning = Prefix + "cri-systemd-cgroup-v1"
30+
// CRIUntrustedWorkloadRuntime is a warning for the `untrusted_workload_runtime` property
31+
CRIUntrustedWorkloadRuntime Warning = Prefix + "cri-untrusted-workload-runtime"
3032
// CRIRegistryMirrors is a warning for the use of the `mirrors` property
3133
CRIRegistryMirrors Warning = Prefix + "cri-registry-mirrors"
3234
// CRIRegistryAuths is a warning for the use of the `auths` property
@@ -49,6 +51,8 @@ var messages = map[Warning]string{
4951
GoPluginLibrary: "Dynamically-linked Go plugins as containerd runtimes will be deprecated in containerd v2.0 and removed in containerd v2.1.",
5052
CRISystemdCgroupV1: "The `systemd_cgroup` property (old form) of `[plugins.\"io.containerd.grpc.v1.cri\"] is deprecated since containerd v1.3 and will be removed in containerd v2.0. " +
5153
"Use `SystemdCgroup` in [plugins.\"io.containerd.grpc.v1.cri\".containerd.runtimes.runc.options] options instead.",
54+
CRIUntrustedWorkloadRuntime: "The `untrusted_workload_runtime` property of [plugins.\"io.containerd.grpc.v1.cri\".containerd] is deprecated since containerd v1.2 and will be removed in containerd v2.0. " +
55+
"Create an `untrusted` runtime in `runtimes` instead.",
5256
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." +
5357
"Use `config_path` instead.",
5458
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)