|
|
|
@ -111,8 +111,6 @@ func coalesceGlobals(dest, src map[string]interface{}) {
|
|
|
|
|
vv := copyMap(val.(map[string]interface{}))
|
|
|
|
|
if destv, ok := dg[key]; !ok {
|
|
|
|
|
// Here there is no merge. We're just adding.
|
|
|
|
|
dg[key] = vv
|
|
|
|
|
continue
|
|
|
|
|
} else {
|
|
|
|
|
if destvmap, ok := destv.(map[string]interface{}); !ok {
|
|
|
|
|
log.Printf("Conflict: cannot merge map onto non-map for %q. Skipping.", key)
|
|
|
|
@ -120,18 +118,17 @@ func coalesceGlobals(dest, src map[string]interface{}) {
|
|
|
|
|
// Basically, we reverse order of coalesce here to merge
|
|
|
|
|
// top-down.
|
|
|
|
|
CoalesceTables(vv, destvmap)
|
|
|
|
|
dg[key] = vv
|
|
|
|
|
continue
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
dg[key] = vv
|
|
|
|
|
} else if dv, ok := dg[key]; ok && istable(dv) {
|
|
|
|
|
// It's not clear if this condition can actually ever trigger.
|
|
|
|
|
log.Printf("key %s is table. Skipping", key)
|
|
|
|
|
continue
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
// TODO: Do we need to do any additional checking on the value?
|
|
|
|
|
dg[key] = val
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
dest[GlobalKey] = dg
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -159,16 +156,16 @@ func coalesceValues(c *chart.Chart, v map[string]interface{}) {
|
|
|
|
|
src, ok := val.(map[string]interface{})
|
|
|
|
|
if !ok {
|
|
|
|
|
// If the original value is nil, there is nothing to coalesce, so we don't print
|
|
|
|
|
// the warning but simply continue
|
|
|
|
|
// the warning
|
|
|
|
|
if val != nil {
|
|
|
|
|
log.Printf("warning: skipped value for %s: Not a table.", key)
|
|
|
|
|
}
|
|
|
|
|
continue
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
// Because v has higher precedence than nv, dest values override src
|
|
|
|
|
// values.
|
|
|
|
|
CoalesceTables(dest, src)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
// If the key is not in v, copy it from nv.
|
|
|
|
|
v[key] = val
|
|
|
|
|