|
|
@ -1003,6 +1003,13 @@ func TestRenderTplRedefines(t *testing.T) {
|
|
|
|
`{{define "manifest-only"}}only-in-manifest{{end}}` +
|
|
|
|
`{{define "manifest-only"}}only-in-manifest{{end}}` +
|
|
|
|
`before: {{include "manifest-only" .}}\n{{tpl .Values.manifestOnlyText .}}\nafter: {{include "manifest-only" .}}`,
|
|
|
|
`before: {{include "manifest-only" .}}\n{{tpl .Values.manifestOnlyText .}}\nafter: {{include "manifest-only" .}}`,
|
|
|
|
)},
|
|
|
|
)},
|
|
|
|
|
|
|
|
{Name: "templates/nested", Data: []byte(
|
|
|
|
|
|
|
|
`{{define "nested"}}original-in-manifest{{end}}` +
|
|
|
|
|
|
|
|
`{{define "nested-outer"}}original-outer-in-manifest{{end}}` +
|
|
|
|
|
|
|
|
`before: {{include "nested" .}} {{include "nested-outer" .}}\n` +
|
|
|
|
|
|
|
|
`{{tpl .Values.nestedText .}}\n` +
|
|
|
|
|
|
|
|
`after: {{include "nested" .}} {{include "nested-outer" .}}`,
|
|
|
|
|
|
|
|
)},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
v := chartutil.Values{
|
|
|
|
v := chartutil.Values{
|
|
|
@ -1010,6 +1017,12 @@ func TestRenderTplRedefines(t *testing.T) {
|
|
|
|
"partialText": `{{define "partial"}}redefined-in-tpl{{end}}tpl: {{include "partial" .}}`,
|
|
|
|
"partialText": `{{define "partial"}}redefined-in-tpl{{end}}tpl: {{include "partial" .}}`,
|
|
|
|
"manifestText": `{{define "manifest"}}redefined-in-tpl{{end}}tpl: {{include "manifest" .}}`,
|
|
|
|
"manifestText": `{{define "manifest"}}redefined-in-tpl{{end}}tpl: {{include "manifest" .}}`,
|
|
|
|
"manifestOnlyText": `tpl: {{include "manifest-only" .}}`,
|
|
|
|
"manifestOnlyText": `tpl: {{include "manifest-only" .}}`,
|
|
|
|
|
|
|
|
"nestedText": `{{define "nested"}}redefined-in-tpl{{end}}` +
|
|
|
|
|
|
|
|
`{{define "nested-outer"}}redefined-outer-in-tpl{{end}}` +
|
|
|
|
|
|
|
|
`before-inner-tpl: {{include "nested" .}} {{include "nested-outer" . }}\n` +
|
|
|
|
|
|
|
|
`{{tpl .Values.innerText .}}\n` +
|
|
|
|
|
|
|
|
`after-inner-tpl: {{include "nested" .}} {{include "nested-outer" . }}`,
|
|
|
|
|
|
|
|
"innerText": `{{define "nested"}}redefined-in-inner-tpl{{end}}inner-tpl: {{include "nested" .}} {{include "nested-outer" . }}`,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
"Chart": c.Metadata,
|
|
|
|
"Chart": c.Metadata,
|
|
|
|
"Release": chartutil.Values{
|
|
|
|
"Release": chartutil.Values{
|
|
|
@ -1026,6 +1039,11 @@ func TestRenderTplRedefines(t *testing.T) {
|
|
|
|
"TplRedefines/templates/partial": `before: original-in-partial\ntpl: redefined-in-tpl\nafter: original-in-partial`,
|
|
|
|
"TplRedefines/templates/partial": `before: original-in-partial\ntpl: redefined-in-tpl\nafter: original-in-partial`,
|
|
|
|
"TplRedefines/templates/manifest": `before: original-in-manifest\ntpl: redefined-in-tpl\nafter: original-in-manifest`,
|
|
|
|
"TplRedefines/templates/manifest": `before: original-in-manifest\ntpl: redefined-in-tpl\nafter: original-in-manifest`,
|
|
|
|
"TplRedefines/templates/manifest-only": `before: only-in-manifest\ntpl: only-in-manifest\nafter: only-in-manifest`,
|
|
|
|
"TplRedefines/templates/manifest-only": `before: only-in-manifest\ntpl: only-in-manifest\nafter: only-in-manifest`,
|
|
|
|
|
|
|
|
"TplRedefines/templates/nested": `before: original-in-manifest original-outer-in-manifest\n` +
|
|
|
|
|
|
|
|
`before-inner-tpl: redefined-in-tpl redefined-outer-in-tpl\n` +
|
|
|
|
|
|
|
|
`inner-tpl: redefined-in-inner-tpl redefined-outer-in-tpl\n` +
|
|
|
|
|
|
|
|
`after-inner-tpl: redefined-in-tpl redefined-outer-in-tpl\n` +
|
|
|
|
|
|
|
|
`after: original-in-manifest original-outer-in-manifest`,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
for file, expect := range expects {
|
|
|
|
for file, expect := range expects {
|
|
|
|
if out[file] != expect {
|
|
|
|
if out[file] != expect {
|
|
|
|