Skip to content

Commit

Permalink
ref(pkg/chartutil): move comment
Browse files Browse the repository at this point in the history
Move comment out of test. Move ref location in test.
  • Loading branch information
rbwsam committed Jul 20, 2017
1 parent 51b5949 commit 8df52b6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
3 changes: 3 additions & 0 deletions pkg/chartutil/values.go
Expand Up @@ -280,6 +280,9 @@ func coalesceValues(c *chart.Chart, v map[string]interface{}) (map[string]interf
for key, val := range nv {
if value, ok := v[key]; ok {
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)
} else if dest, ok := value.(map[string]interface{}); ok {
// if v[key] is a table, merge nv's val table into v[key].
Expand Down
5 changes: 1 addition & 4 deletions pkg/chartutil/values_test.go
Expand Up @@ -275,6 +275,7 @@ func ttpl(tpl string, v map[string]interface{}) (string, error) {
return b.String(), nil
}

// ref: http://www.yaml.org/spec/1.2/spec.html#id2803362
var testCoalesceValuesYaml = `
top: yup
bottom: null
Expand Down Expand Up @@ -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"}
for _, nullKey := range nullKeys {
if _, ok := v[nullKey]; ok {
Expand Down

0 comments on commit 8df52b6

Please sign in to comment.