From 15cbd54d1c4dc8a84b199aee1e6bcef91c097e41 Mon Sep 17 00:00:00 2001 From: Evan Lezar Date: Wed, 25 May 2022 20:10:28 +0200 Subject: [PATCH] Also set Runtime file v1 containerd runtime config This ensures that older versions of containerd that may be expecting this over options.BinaryName should continue to work. Signed-off-by: Evan Lezar --- tools/container/containerd/config.go | 3 +++ tools/container/containerd/config_v1_test.go | 2 ++ 2 files changed, 5 insertions(+) diff --git a/tools/container/containerd/config.go b/tools/container/containerd/config.go index 629ec7f3..2e61be5d 100644 --- a/tools/container/containerd/config.go +++ b/tools/container/containerd/config.go @@ -48,6 +48,9 @@ func (config *config) update(runtimeClass string, runtimeType string, runtimeBin } config.initRuntime(runtimeClassPath, runtimeType, "BinaryName", runtimeBinary) + if config.version == 1 { + config.initRuntime(runtimeClassPath, runtimeType, "Runtime", runtimeBinary) + } if setAsDefault { defaultRuntimeNamePath := config.defaultRuntimeNamePath() diff --git a/tools/container/containerd/config_v1_test.go b/tools/container/containerd/config_v1_test.go index b1f39677..0b69f5aa 100644 --- a/tools/container/containerd/config_v1_test.go +++ b/tools/container/containerd/config_v1_test.go @@ -349,6 +349,7 @@ func runtimeMapV1(binary string) map[string]interface{} { "privileged_without_host_devices": false, "options": map[string]interface{}{ "BinaryName": binary, + "Runtime": binary, }, } } @@ -376,6 +377,7 @@ func runcRuntimeConfigMapV1(binary string) map[string]interface{} { "options": map[string]interface{}{ "runc-option": "value", "BinaryName": binary, + "Runtime": binary, }, } }