Skip to content

Commit

Permalink
Fix overwriting docker feature flags
Browse files Browse the repository at this point in the history
Signed-off-by: Evan Lezar <[email protected]>
  • Loading branch information
elezar committed Jan 27, 2025
1 parent e89be14 commit 2b417c1
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion pkg/config/engine/docker/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2b417c1

Please sign in to comment.