Skip to content

Commit 833b941

Browse files
samuelkarpruiwen-zhao
authored andcommitted
cri: add deprecation warning for rutnime_engine
Signed-off-by: Samuel Karp <[email protected]> (cherry picked from commit 8040e74) Signed-off-by: ruiwen-zhao <[email protected]>
1 parent 47de3d6 commit 833b941

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
@@ -391,6 +391,7 @@ func ValidatePluginConfig(ctx context.Context, c *PluginConfig) ([]deprecation.W
391391
if r.Type != plugin.RuntimeLinuxV1 {
392392
return warnings, fmt.Errorf("`runtime_engine` only works for runtime %s", plugin.RuntimeLinuxV1)
393393
}
394+
warnings = append(warnings, deprecation.CRIRuntimeEngine)
394395
log.G(ctx).Warning("`runtime_engine` is deprecated, please use runtime `options` instead")
395396
}
396397
if r.Root != "" {

pkg/cri/config/config_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@ func TestValidateConfig(t *testing.T) {
220220
},
221221
},
222222
},
223+
warnings: []deprecation.Warning{deprecation.CRIRuntimeEngine},
223224
},
224225
"deprecated runtime_engine for v2 runtime": {
225226
config: &PluginConfig{

pkg/deprecation/deprecation.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ const (
3131
CRIUntrustedWorkloadRuntime Warning = Prefix + "cri-untrusted-workload-runtime"
3232
// CRIDefaultRuntime is a warning for the `default_runtime` property
3333
CRIDefaultRuntime Warning = Prefix + "cri-default-runtime"
34+
// CRIRuntimeEngine is a warning for the `runtime_engine` property
35+
CRIRuntimeEngine Warning = Prefix + "cri-runtime-engine"
3436
// CRIRegistryMirrors is a warning for the use of the `mirrors` property
3537
CRIRegistryMirrors Warning = Prefix + "cri-registry-mirrors"
3638
// CRIRegistryAuths is a warning for the use of the `auths` property
@@ -57,6 +59,8 @@ var messages = map[Warning]string{
5759
"Create an `untrusted` runtime in `runtimes` instead.",
5860
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. " +
5961
"Use `default_runtime_name` instead.",
62+
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. " +
63+
"Use a v2 runtime and `options` instead.",
6064
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." +
6165
"Use `config_path` instead.",
6266
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)