From f8bef75fef6643983dfc1514eca49994d0ad2744 Mon Sep 17 00:00:00 2001 From: devShaik010 <20dpcs044hy@manuu.edu.in> Date: Tue, 16 Jun 2026 21:43:00 +0530 Subject: [PATCH] fix: clarify coalesce warning messages Signed-off-by: devShaik010 <20dpcs044hy@manuu.edu.in> --- pkg/chart/common/util/coalesce.go | 6 +++--- pkg/chart/common/util/coalesce_test.go | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pkg/chart/common/util/coalesce.go b/pkg/chart/common/util/coalesce.go index 999eeb208..2d01aaedb 100644 --- a/pkg/chart/common/util/coalesce.go +++ b/pkg/chart/common/util/coalesce.go @@ -245,7 +245,7 @@ func coalesceValues(printf printFn, c chart.Charter, v map[string]any, prefix st // If the original value is nil, there is nothing to coalesce, so we don't print // the warning if val != nil { - printf("warning: skipped value for %s.%s: Not a table.", subPrefix, key) + printf("warning: skipped value for %s.%s: expected a map, got non-map value (%v)", subPrefix, key, val) } } else { // If the key is a child chart, coalesce tables with Merge set to true @@ -347,10 +347,10 @@ func coalesceTablesFullKey(printf printFn, dst, src map[string]any, prefix strin if istable(dv) { coalesceTablesFullKey(printf, dv.(map[string]any), val.(map[string]any), fullkey, merge) } else { - printf("warning: cannot overwrite table with non table for %s (%v)", fullkey, val) + printf("warning: cannot overwrite map with non-map for %s (%v)", fullkey, val) } } else if istable(dv) && val != nil { - printf("warning: destination for %s is a table. Ignoring non-table value (%v)", fullkey, val) + printf("warning: destination for %s is a map. Ignoring non-map value (%v)", fullkey, val) } } return dst diff --git a/pkg/chart/common/util/coalesce_test.go b/pkg/chart/common/util/coalesce_test.go index 33274920c..9e751ee6d 100644 --- a/pkg/chart/common/util/coalesce_test.go +++ b/pkg/chart/common/util/coalesce_test.go @@ -720,9 +720,9 @@ func TestCoalesceValuesWarnings(t *testing.T) { } t.Logf("vals: %v", vals) - assert.Contains(t, warnings, "warning: skipped value for level1.level2.level3.boat: Not a table.") - assert.Contains(t, warnings, "warning: destination for level1.level2.level3.spear.tip is a table. Ignoring non-table value (true)") - assert.Contains(t, warnings, "warning: cannot overwrite table with non table for level1.level2.level3.spear.sail (map[cotton:true])") + assert.Contains(t, warnings, "warning: skipped value for level1.level2.level3.boat: expected a map, got non-map value (true)") + assert.Contains(t, warnings, "warning: destination for level1.level2.level3.spear.tip is a map. Ignoring non-map value (true)") + assert.Contains(t, warnings, "warning: cannot overwrite map with non-map for level1.level2.level3.spear.sail (map[cotton:true])") } func TestConcatPrefix(t *testing.T) {