ref(pkg/chartutil): move comment

Move comment out of test. Move ref location in test.
pull/2704/head
Sam Leavens 8 years ago
parent 51b59497ee
commit 8df52b6501

@ -280,6 +280,9 @@ func coalesceValues(c *chart.Chart, v map[string]interface{}) (map[string]interf
for key, val := range nv { for key, val := range nv {
if value, ok := v[key]; ok { if value, ok := v[key]; ok {
if value == nil { if value == nil {
// When the YAML value is null, we 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.
delete(v, key) delete(v, key)
} else if dest, ok := value.(map[string]interface{}); ok { } else if dest, ok := value.(map[string]interface{}); ok {
// if v[key] is a table, merge nv's val table into v[key]. // if v[key] is a table, merge nv's val table into v[key].

@ -275,6 +275,7 @@ func ttpl(tpl string, v map[string]interface{}) (string, error) {
return b.String(), nil return b.String(), nil
} }
// ref: http://www.yaml.org/spec/1.2/spec.html#id2803362
var testCoalesceValuesYaml = ` var testCoalesceValuesYaml = `
top: yup top: yup
bottom: null bottom: null
@ -350,10 +351,6 @@ func TestCoalesceValues(t *testing.T) {
} }
} }
// When the YAML value is null, we 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
nullKeys := []string{"bottom", "right", "left", "front"} nullKeys := []string{"bottom", "right", "left", "front"}
for _, nullKey := range nullKeys { for _, nullKey := range nullKeys {
if _, ok := v[nullKey]; ok { if _, ok := v[nullKey]; ok {

Loading…
Cancel
Save