From ef2eb552837446fe8a5a91bc68abf4d9eab685a8 Mon Sep 17 00:00:00 2001 From: Ryan Hockstad Date: Thu, 2 Jan 2025 22:19:19 -0500 Subject: [PATCH] Add test case for removing an entire object Signed-off-by: Ryan Hockstad --- pkg/chartutil/coalesce_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkg/chartutil/coalesce_test.go b/pkg/chartutil/coalesce_test.go index 774536487..622d99cc9 100644 --- a/pkg/chartutil/coalesce_test.go +++ b/pkg/chartutil/coalesce_test.go @@ -57,6 +57,7 @@ pequod: nested: foo: true boat: null + object: null `) func withDeps(c *chart.Chart, deps ...*chart.Chart) *chart.Chart { @@ -118,6 +119,7 @@ func TestCoalesceValues(t *testing.T) { "name": "ahab", "boat": true, "nested": map[string]interface{}{"foo": false, "boat": true}, + "object": map[string]interface{}{"foo": "bar"}, }, }, ), @@ -227,6 +229,10 @@ func TestCoalesceValues(t *testing.T) { t.Error("Expected sub-subchart nested boat key to be removed, still present") } + if _, ok := subsubchart["object"]; ok { + t.Error("Expected sub-subchart object map to be removed, still present") + } + // CoalesceValues should not mutate the passed arguments is.Equal(valsCopy, vals) }