Merge pull request #6080 from deitmerit/fix/subchart-value-deletion

Fix subchart value deletion
pull/6146/head
Taylor Thomas 5 years ago committed by GitHub
commit f4a55985b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1 +1,2 @@
scope: spouter
foo: bar

@ -22,3 +22,7 @@ web:
httpGet:
path: /api/v1/info
port: atc
# for testing deleting default values in sub charts
spouter:
foo: null

@ -170,10 +170,7 @@ func CoalesceValues(chrt *chart.Chart, vals *chart.Config) (Values, error) {
if err != nil {
return cvals, err
}
cvals, err = coalesce(chrt, evals)
if err != nil {
return cvals, err
}
return coalesce(chrt, evals)
}
return coalesceDeps(chrt, cvals)

@ -475,6 +475,33 @@ func TestCoalesceTables(t *testing.T) {
t.Errorf("Expected boat string, got %v", dst["boat"])
}
}
func TestCoalesceSubchart(t *testing.T) {
tchart := "testdata/moby"
c, err := LoadDir(tchart)
if err != nil {
t.Fatal(err)
}
tvals := &chart.Config{}
v, err := CoalesceValues(c, tvals)
if err != nil {
t.Fatal(err)
}
j, _ := json.MarshalIndent(v, "", " ")
t.Logf("Coalesced Values: %s", string(j))
subchartValues, ok := v["spouter"].(map[string]interface{})
if !ok {
t.Errorf("Subchart values not found")
}
if _, ok := subchartValues["foo"]; ok {
t.Errorf("Expected key foo to be removed, still present")
}
}
func TestPathValue(t *testing.T) {
doc := `
title: "Moby Dick"

Loading…
Cancel
Save