diff --git a/pkg/chartutil/values.go b/pkg/chartutil/values.go index 66a2658d5..2db15c7bd 100644 --- a/pkg/chartutil/values.go +++ b/pkg/chartutil/values.go @@ -316,6 +316,8 @@ func coalesceTables(dst, src map[string]interface{}) map[string]interface{} { dst[key] = val } else if istable(innerdst) { coalesceTables(innerdst.(map[string]interface{}), val.(map[string]interface{})) + } else if isnull(innerdst) { + delete(dst, key) } else { log.Printf("warning: cannot overwrite table with non table for %s (%v)", key, val) } @@ -388,6 +390,11 @@ func istable(v interface{}) bool { return ok } +// isnull is a special-purpose function to see if the present thing matches the definition of a YAML null. +func isnull(v interface{}) bool { + return v == "null" || v == "Null" || v == "NULL" || v == "~" +} + // PathValue takes a path that traverses a YAML structure and returns the value at the end of that path. // The path starts at the root of the YAML structure and is comprised of YAML keys separated by periods. // Given the following YAML data the value at path "chapter.one.title" is "Loomings".