Bump compose-go v2.1.5

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
Nicolas De Loof
2024-07-23 17:06:43 +02:00
parent aa35c954f3
commit c4d3011a98
9 changed files with 80 additions and 83 deletions

View File

@ -237,20 +237,33 @@ func mergeIPAMConfig(c any, o any, path tree.Path) (any, error) {
return ipamConfigs, nil
}
func convertIntoMapping(a any, defaultValue any) map[string]any {
func convertIntoMapping(a any, defaultValue map[string]any) map[string]any {
switch v := a.(type) {
case map[string]any:
return v
case []any:
converted := map[string]any{}
for _, s := range v {
converted[s.(string)] = defaultValue
if defaultValue == nil {
converted[s.(string)] = nil
} else {
// Create a new map for each key
converted[s.(string)] = copyMap(defaultValue)
}
}
return converted
}
return nil
}
func copyMap(m map[string]any) map[string]any {
c := make(map[string]any)
for k, v := range m {
c[k] = v
}
return c
}
func override(_ any, other any, _ tree.Path) (any, error) {
return other, nil
}