Skip to content

Commit

Permalink
cri: add warning for untrusted_workload_runtime
Browse files Browse the repository at this point in the history
Signed-off-by: Samuel Karp <samuelkarp@google.com>
(cherry picked from commit afef7ec)
Signed-off-by: ruiwen-zhao <ruiwen@google.com>
  • Loading branch information
samuelkarp authored and ruiwen-zhao committed Dec 14, 2023
1 parent 802cb64 commit d421b8f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkg/cri/config/config.go
Expand Up @@ -351,6 +351,7 @@ func ValidatePluginConfig(ctx context.Context, c *PluginConfig) ([]deprecation.W
if _, ok := c.ContainerdConfig.Runtimes[RuntimeUntrusted]; ok {
return warnings, fmt.Errorf("conflicting definitions: configuration includes both `untrusted_workload_runtime` and `runtimes[%q]`", RuntimeUntrusted)
}
warnings = append(warnings, deprecation.CRIUntrustedWorkloadRuntime)
c.ContainerdConfig.Runtimes[RuntimeUntrusted] = c.ContainerdConfig.UntrustedWorkloadRuntime
}

Expand Down
1 change: 1 addition & 0 deletions pkg/cri/config/config_test.go
Expand Up @@ -64,6 +64,7 @@ func TestValidateConfig(t *testing.T) {
},
},
},
warnings: []deprecation.Warning{deprecation.CRIUntrustedWorkloadRuntime},
},
"both untrusted_workload_runtime and runtime[untrusted]": {
config: &PluginConfig{
Expand Down
4 changes: 4 additions & 0 deletions pkg/deprecation/deprecation.go
Expand Up @@ -27,6 +27,8 @@ const (
GoPluginLibrary Warning = Prefix + "go-plugin-library"
// CRISystemdCgroupV1 is a warning for the `systemd_cgroup` property
CRISystemdCgroupV1 Warning = Prefix + "cri-systemd-cgroup-v1"
// CRIUntrustedWorkloadRuntime is a warning for the `untrusted_workload_runtime` property
CRIUntrustedWorkloadRuntime Warning = Prefix + "cri-untrusted-workload-runtime"
// CRIRegistryMirrors is a warning for the use of the `mirrors` property
CRIRegistryMirrors Warning = Prefix + "cri-registry-mirrors"
// CRIRegistryAuths is a warning for the use of the `auths` property
Expand All @@ -49,6 +51,8 @@ var messages = map[Warning]string{
GoPluginLibrary: "Dynamically-linked Go plugins as containerd runtimes are deprecated since containerd v2.0 and removed in containerd v2.1.",
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. " +
"Use `SystemdCgroup` in [plugins.\"io.containerd.grpc.v1.cri\".containerd.runtimes.runc.options] options instead.",
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. " +
"Create an `untrusted` runtime in `runtimes` instead.",
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." +
"Use `config_path` instead.",
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." +
Expand Down

0 comments on commit d421b8f

Please sign in to comment.