|
|
|
|
@ -302,6 +302,15 @@ func coalesceTablesFullKey(printf printFn, dst, src map[string]interface{}, pref
|
|
|
|
|
if dst == nil {
|
|
|
|
|
return src
|
|
|
|
|
}
|
|
|
|
|
// Track original non-nil src keys before modifying src
|
|
|
|
|
// This lets us distinguish between user nullifying a chart default vs
|
|
|
|
|
// user setting nil for a key not in chart defaults.
|
|
|
|
|
srcOriginalNonNil := make(map[string]bool)
|
|
|
|
|
for key, val := range src {
|
|
|
|
|
if val != nil {
|
|
|
|
|
srcOriginalNonNil[key] = true
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
for key, val := range dst {
|
|
|
|
|
if val == nil {
|
|
|
|
|
src[key] = nil
|
|
|
|
|
@ -311,9 +320,13 @@ func coalesceTablesFullKey(printf printFn, dst, src map[string]interface{}, pref
|
|
|
|
|
// values.
|
|
|
|
|
for key, val := range src {
|
|
|
|
|
fullkey := concatPrefix(prefix, key)
|
|
|
|
|
if dv, ok := dst[key]; ok && !merge && dv == nil {
|
|
|
|
|
if dv, ok := dst[key]; ok && !merge && dv == nil && srcOriginalNonNil[key] {
|
|
|
|
|
// When coalescing (not merging), if dst has nil and src has a non-nil
|
|
|
|
|
// value, the user is nullifying a chart default - remove the key.
|
|
|
|
|
// But if src also has nil (or key not in src), preserve the nil
|
|
|
|
|
delete(dst, key)
|
|
|
|
|
} else if !ok {
|
|
|
|
|
// key not in user values, preserve src value (including nil)
|
|
|
|
|
dst[key] = val
|
|
|
|
|
} else if istable(val) {
|
|
|
|
|
if istable(dv) {
|
|
|
|
|
|