diff --git a/pkg/chartutil/testdata/moby/values.yaml b/pkg/chartutil/testdata/moby/values.yaml index 1972c0844..54e1ce463 100644 --- a/pkg/chartutil/testdata/moby/values.yaml +++ b/pkg/chartutil/testdata/moby/values.yaml @@ -2,3 +2,8 @@ scope: moby name: moby override: bad top: nope +bottom: exists +right: exists +left: exists +front: exists +back: exists diff --git a/pkg/chartutil/values_test.go b/pkg/chartutil/values_test.go index 465eee8a4..7d5750bd5 100644 --- a/pkg/chartutil/values_test.go +++ b/pkg/chartutil/values_test.go @@ -277,6 +277,11 @@ func ttpl(tpl string, v map[string]interface{}) (string, error) { var testCoalesceValuesYaml = ` top: yup +bottom: null +right: Null +left: NULL +front: ~ +back: "" global: name: Ishmael @@ -316,6 +321,7 @@ func TestCoalesceValues(t *testing.T) { expect string }{ {"{{.top}}", "yup"}, + {"{{.back}}", ""}, {"{{.name}}", "moby"}, {"{{.global.name}}", "Ishmael"}, {"{{.global.subject}}", "Queequeg"}, @@ -343,6 +349,13 @@ func TestCoalesceValues(t *testing.T) { t.Errorf("Expected %q to expand to %q, got %q", tt.tpl, tt.expect, o) } } + + nullKeys := []string{"bottom", "right", "left", "front"} + for _, nullKey := range nullKeys { + if _, ok := v[nullKey]; ok { + t.Errorf("Expected key %q to be removed, still present", nullKey) + } + } } func TestCoalesceTables(t *testing.T) {