Commit 225d3a8a authored by Matt Butcher's avatar Matt Butcher

test(engine): add test case for deep release passing

parent e00f774a
......@@ -238,7 +238,6 @@ func (s *releaseServer) InstallRelease(c ctx.Context, req *services.InstallRelea
// Render the templates
// TODO: Fix based on whether chart has `engine: SOMETHING` set.
//vals, err := chartutil.CoalesceValues(req.Chart, req.Values, overrides)
vals, err := chartutil.CoalesceValues(req.Chart, req.Values, nil)
if err != nil {
return nil, err
......@@ -248,7 +247,6 @@ func (s *releaseServer) InstallRelease(c ctx.Context, req *services.InstallRelea
renderer := s.engine(req.Chart)
files, err := renderer.Render(req.Chart, overrides)
//files, err := renderer.Render(req.Chart, vals)
if err != nil {
return nil, err
}
......
......@@ -215,11 +215,13 @@ func TestRenderNestedValues(t *testing.T) {
innerpath := "charts/inner/templates/inner.tpl"
outerpath := "templates/outer.tpl"
deepestpath := "charts/inner/charts/deepest/templates/deepest.tpl"
checkrelease := "charts/inner/charts/deepest/templates/release.tpl"
deepest := &chart.Chart{
Metadata: &chart.Metadata{Name: "deepest"},
Templates: []*chart.Template{
{Name: deepestpath, Data: []byte(`And this same {{.Values.what}} that smiles {{.Values.global.when}}`)},
{Name: checkrelease, Data: []byte(`Tomorrow will be {{default "happy" .Release.Name }}`)},
},
Values: &chart.Config{Raw: `what: "milkshake"`},
}
......@@ -267,7 +269,7 @@ global:
"Values": tmp,
"Chart": outer.Metadata,
"Release": chartutil.Values{
"Name": "Robert",
"Name": "dyin",
},
}
......@@ -289,4 +291,8 @@ global:
if out[deepestpath] != "And this same flower that smiles to-day" {
t.Errorf("Unexpected deepest: %q", out[deepestpath])
}
if out[checkrelease] != "Tomorrow will be dyin" {
t.Errorf("Unexpected release: %q", out[checkrelease])
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment