From dad3e855b5c2b62cca645f10d82b36b4bf10e5d3 Mon Sep 17 00:00:00 2001 From: Evan Lezar Date: Fri, 27 May 2022 16:18:57 +0200 Subject: [PATCH] Also cleanup v1 default_runtime if BinaryName is set Signed-off-by: Evan Lezar --- tools/container/containerd/config_v1.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tools/container/containerd/config_v1.go b/tools/container/containerd/config_v1.go index 1d98776f..f3121c18 100644 --- a/tools/container/containerd/config_v1.go +++ b/tools/container/containerd/config_v1.go @@ -84,6 +84,14 @@ func (config *configV1) Revert(o *options) error { } } } + if runtime, ok := config.GetPath(append(defaultRuntimeOptionsPath, "BinaryName")).(string); ok { + for _, runtimeBinary := range o.getRuntimeBinaries() { + if path.Base(runtimeBinary) == path.Base(runtime) { + config.DeletePath(append(defaultRuntimeOptionsPath, "BinaryName")) + break + } + } + } if options, ok := config.GetPath(defaultRuntimeOptionsPath).(*toml.Tree); ok { if len(options.Keys()) == 0 {