From 4be00c51cc46b492ba63ef1a644c6265e5e52a88 Mon Sep 17 00:00:00 2001 From: Scott Rigby Date: Fri, 7 Jul 2017 00:18:51 -0400 Subject: [PATCH] Tests for allow null to delete values key --- pkg/chartutil/testdata/moby/values.yaml | 6 ++++++ pkg/chartutil/values_test.go | 8 ++++++++ 2 files changed, 14 insertions(+) diff --git a/pkg/chartutil/testdata/moby/values.yaml b/pkg/chartutil/testdata/moby/values.yaml index 1972c0844..e90f4488f 100644 --- a/pkg/chartutil/testdata/moby/values.yaml +++ b/pkg/chartutil/testdata/moby/values.yaml @@ -2,3 +2,9 @@ scope: moby name: moby override: bad top: nope +bottom: exists +right: exists +left: exists +front: exists +back: exists +side: exists diff --git a/pkg/chartutil/values_test.go b/pkg/chartutil/values_test.go index 465eee8a4..2df1e6d77 100644 --- a/pkg/chartutil/values_test.go +++ b/pkg/chartutil/values_test.go @@ -277,6 +277,12 @@ func ttpl(tpl string, v map[string]interface{}) (string, error) { var testCoalesceValuesYaml = ` top: yup +bottom: null +right: Null +left: NULL +front: ~ +back: +side: "" global: name: Ishmael @@ -316,6 +322,8 @@ func TestCoalesceValues(t *testing.T) { expect string }{ {"{{.top}}", "yup"}, + // The keys bottom, right, left, front, and back should not be present. + {"{{.side}}", ""}, {"{{.name}}", "moby"}, {"{{.global.name}}", "Ishmael"}, {"{{.global.subject}}", "Queequeg"},