diff --git a/pkg/chartutil/coalesce.go b/pkg/chartutil/coalesce.go index e086d8b6e..7b1ee1d80 100644 --- a/pkg/chartutil/coalesce.go +++ b/pkg/chartutil/coalesce.go @@ -127,9 +127,10 @@ func coalesceGlobals(dest, src map[string]interface{}) { // It's not clear if this condition can actually ever trigger. log.Printf("key %s is table. Skipping", key) continue + } else { + // TODO: Do we need to do any additional checking on the value? + dg[key] = val } - // TODO: Do we need to do any additional checking on the value? - dg[key] = val } dest[GlobalKey] = dg } diff --git a/pkg/chartutil/coalesce_test.go b/pkg/chartutil/coalesce_test.go index 5a4656d71..fc55e0a25 100644 --- a/pkg/chartutil/coalesce_test.go +++ b/pkg/chartutil/coalesce_test.go @@ -87,6 +87,9 @@ func TestCoalesceValues(t *testing.T) { &chart.Chart{ Metadata: &chart.Metadata{Name: "ahab"}, Values: map[string]interface{}{ + "global": map[string]interface{}{ + "nested": map[string]interface{}{"foo": "bar"}, + }, "scope": "ahab", "name": "ahab", "boat": true, @@ -135,9 +138,11 @@ func TestCoalesceValues(t *testing.T) { {"{{.pequod.ahab.scope}}", "whale"}, {"{{.pequod.ahab.nested.foo}}", "true"}, {"{{.pequod.ahab.global.name}}", "Ishmael"}, + {"{{.pequod.ahab.global.nested.foo}}", "bar"}, {"{{.pequod.ahab.global.subject}}", "Queequeg"}, {"{{.pequod.ahab.global.harpooner}}", "Tashtego"}, {"{{.pequod.global.name}}", "Ishmael"}, + {"{{.pequod.global.nested.foo}}", ""}, {"{{.pequod.global.subject}}", "Queequeg"}, {"{{.spouter.global.name}}", "Ishmael"}, {"{{.spouter.global.harpooner}}", ""},