mirror of
https://github.com/NVIDIA/nvidia-container-toolkit
synced 2025-02-04 03:56:23 +00:00
Fix overwriting docker feature flags
Signed-off-by: Evan Lezar <elezar@nvidia.com>
This commit is contained in:
parent
e89be14c86
commit
2b417c1a9a
@ -105,7 +105,20 @@ func (c Config) DefaultRuntime() string {
|
||||
|
||||
// EnableCDI sets features.cdi to true in the docker config.
|
||||
func (c *Config) EnableCDI() {
|
||||
(*c)["features"] = map[string]bool{"cdi": true}
|
||||
if c == nil {
|
||||
return
|
||||
}
|
||||
config := *c
|
||||
|
||||
features, ok := config["features"].(map[string]bool)
|
||||
if !ok {
|
||||
features = make(map[string]bool)
|
||||
}
|
||||
features["cdi"] = true
|
||||
|
||||
config["features"] = features
|
||||
|
||||
*c = config
|
||||
}
|
||||
|
||||
// RemoveRuntime removes a runtime from the docker config
|
||||
|
Loading…
Reference in New Issue
Block a user