fix(helm): Apply PR comments for tpl template name fix

Modified existing unit test to verify the changed behavior.
Removed debug print.
pull/3061/head
Lukas Eichler 7 years ago
parent 1cebc760a0
commit 8bc7dede18
No known key found for this signature in database
GPG Key ID: 692D162D1550AE1B

@ -177,8 +177,6 @@ func (e *Engine) alterFuncMap(t *template.Template) template.FuncMap {
basePath: basePath.(string),
}
println(vals.Table)
templates := map[string]renderable{}
templateName, err := vals.PathValue("Template.Name")
if err != nil {

@ -538,7 +538,7 @@ func TestAlterFuncMap(t *testing.T) {
Metadata: &chart.Metadata{Name: "TplFunction"},
Templates: []*chart.Template{
{Name: "templates/base", Data: []byte(`{{ tpl "{{include ` + "`" + `TplFunction/templates/_partial` + "`" + ` . | quote }}" .}}`)},
{Name: "templates/_partial", Data: []byte(`{{.Release.Name}}`)},
{Name: "templates/_partial", Data: []byte(`{{.Template.Name}}`)},
},
Values: &chart.Config{Raw: ``},
Dependencies: []*chart.Chart{},
@ -558,7 +558,7 @@ func TestAlterFuncMap(t *testing.T) {
t.Fatal(err)
}
expectedTplStrWithInclude := "\"TestRelease\""
expectedTplStrWithInclude := "\"TplFunction/templates/base\""
if gotStrTplWithInclude := outTplWithInclude["TplFunction/templates/base"]; gotStrTplWithInclude != expectedTplStrWithInclude {
t.Errorf("Expected %q, got %q (%v)", expectedTplStrWithInclude, gotStrTplWithInclude, outTplWithInclude)
}

Loading…
Cancel
Save