From 326c1e3f6782a7ed53980ac010c44689c0ae4fb6 Mon Sep 17 00:00:00 2001 From: Ryan Hockstad Date: Wed, 15 Jan 2025 23:29:14 -0500 Subject: [PATCH] add test for nullifying nested global value Signed-off-by: Ryan Hockstad --- pkg/chartutil/coalesce_test.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/chartutil/coalesce_test.go b/pkg/chartutil/coalesce_test.go index 622d99cc9..e0829b9e3 100644 --- a/pkg/chartutil/coalesce_test.go +++ b/pkg/chartutil/coalesce_test.go @@ -51,6 +51,7 @@ pequod: nested: boat: false sail: true + foo2: null ahab: scope: whale boat: null @@ -112,7 +113,7 @@ func TestCoalesceValues(t *testing.T) { Metadata: &chart.Metadata{Name: "ahab"}, Values: map[string]interface{}{ "global": map[string]interface{}{ - "nested": map[string]interface{}{"foo": "bar"}, + "nested": map[string]interface{}{"foo": "bar", "foo2": "bar2"}, "nested2": map[string]interface{}{"l2": "ahab"}, }, "scope": "ahab", @@ -170,6 +171,7 @@ func TestCoalesceValues(t *testing.T) { {"{{.pequod.ahab.nested.foo}}", "true"}, {"{{.pequod.ahab.global.name}}", "Ishmael"}, {"{{.pequod.ahab.global.nested.foo}}", "bar"}, + {"{{.pequod.ahab.global.nested.foo2}}", ""}, {"{{.pequod.ahab.global.subject}}", "Queequeg"}, {"{{.pequod.ahab.global.harpooner}}", "Tashtego"}, {"{{.pequod.global.name}}", "Ishmael"},