diff --git a/pkg/chartutil/values.go b/pkg/chartutil/values.go index cc60860cd..b66a2557b 100644 --- a/pkg/chartutil/values.go +++ b/pkg/chartutil/values.go @@ -278,6 +278,19 @@ func coalesceValues(c *chart.Chart, v map[string]interface{}) (map[string]interf } for key, val := range nv { + // If the value is YAML null, remove the value's key. + // This allows Helm's various sources of values (value files or --set) to + // remove incompatible keys from any previous chart, file, or set values. + // ref: http://www.yaml.org/spec/1.2/spec.html#id2803362 + switch val { + case "null": + case "Null": + case "NULL": + case "~": + delete(v, key) + continue + } + if _, ok := v[key]; !ok { // If the key is not in v, copy it from nv. v[key] = val