Also cleanup v1 default_runtime if BinaryName is set

Signed-off-by: Evan Lezar <elezar@nvidia.com>
This commit is contained in:
Evan Lezar 2022-05-27 16:18:57 +02:00
parent 15cbd54d1c
commit dad3e855b5

View File

@ -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 options, ok := config.GetPath(defaultRuntimeOptionsPath).(*toml.Tree); ok {
if len(options.Keys()) == 0 { if len(options.Keys()) == 0 {