mirror of
https://github.com/helm/helm.git
synced 2026-08-04 23:20:49 +00:00
fix(helm): Apply PR comments for tpl template name fix
Modified existing unit test to verify the changed behavior. Removed debug print.
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user