Skip to content

Commit d421b8f

Browse files
samuelkarpruiwen-zhao
authored andcommitted
cri: add warning for untrusted_workload_runtime
Signed-off-by: Samuel Karp <[email protected]> (cherry picked from commit afef7ec) Signed-off-by: ruiwen-zhao <[email protected]>
1 parent 802cb64 commit d421b8f

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
@@ -351,6 +351,7 @@ func ValidatePluginConfig(ctx context.Context, c *PluginConfig) ([]deprecation.W
351351
if _, ok := c.ContainerdConfig.Runtimes[RuntimeUntrusted]; ok {
352352
return warnings, fmt.Errorf("conflicting definitions: configuration includes both `untrusted_workload_runtime` and `runtimes[%q]`", RuntimeUntrusted)
353353
}
354+
warnings = append(warnings, deprecation.CRIUntrustedWorkloadRuntime)
354355
c.ContainerdConfig.Runtimes[RuntimeUntrusted] = c.ContainerdConfig.UntrustedWorkloadRuntime
355356
}
356357

pkg/cri/config/config_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ func TestValidateConfig(t *testing.T) {
6464
},
6565
},
6666
},
67+
warnings: []deprecation.Warning{deprecation.CRIUntrustedWorkloadRuntime},
6768
},
6869
"both untrusted_workload_runtime and runtime[untrusted]": {
6970
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 are deprecated since 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)