Skip to content

Commit

Permalink
cri: add deprecation warning for rutnime_engine
Browse files Browse the repository at this point in the history
Signed-off-by: Samuel Karp <samuelkarp@google.com>
  • Loading branch information
samuelkarp committed Dec 6, 2023
1 parent 99adc40 commit 8040e74
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
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,7 @@ func ValidatePluginConfig(ctx context.Context, c *PluginConfig) ([]deprecation.W
if r.Type != plugin.RuntimeLinuxV1 {
return warnings, fmt.Errorf("`runtime_engine` only works for runtime %s", plugin.RuntimeLinuxV1)
}
warnings = append(warnings, deprecation.CRIRuntimeEngine)
log.G(ctx).Warning("`runtime_engine` is deprecated, please use runtime `options` instead")
}
if r.Root != "" {
Expand Down
1 change: 1 addition & 0 deletions pkg/cri/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ func TestValidateConfig(t *testing.T) {
},
},
},
warnings: []deprecation.Warning{deprecation.CRIRuntimeEngine},
},
"deprecated runtime_engine for v2 runtime": {
config: &PluginConfig{
Expand Down
4 changes: 4 additions & 0 deletions pkg/deprecation/deprecation.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ const (
CRIUntrustedWorkloadRuntime Warning = Prefix + "cri-untrusted-workload-runtime"
// CRIDefaultRuntime is a warning for the `default_runtime` property
CRIDefaultRuntime Warning = Prefix + "cri-default-runtime"
// CRIRuntimeEngine is a warning for the `runtime_engine` property
CRIRuntimeEngine Warning = Prefix + "cri-runtime-engine"
// 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 @@ -57,6 +59,8 @@ var messages = map[Warning]string{
"Create an `untrusted` runtime in `runtimes` instead.",
CRIDefaultRuntime: "The `default_runtime` property of [plugins.\"io.containerd.grpc.v1.cri\".containerd] is deprecated since containerd v1.3 and will be removed in containerd v2.0. " +
"Use `default_runtime_name` instead.",
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. " +
"Use a v2 runtime and `options` 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 8040e74

Please sign in to comment.