|
|
@ -460,6 +460,15 @@ func TestAlterFuncMap_include(t *testing.T) {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Check nested reference in include FuncMap
|
|
|
|
|
|
|
|
d := &chart.Chart{
|
|
|
|
|
|
|
|
Metadata: &chart.Metadata{Name: "nested"},
|
|
|
|
|
|
|
|
Templates: []*chart.File{
|
|
|
|
|
|
|
|
{Name: "templates/quote", Data: []byte(`{{include "nested/templates/quote" . | indent 2}} dead.`)},
|
|
|
|
|
|
|
|
{Name: "templates/_partial", Data: []byte(`{{.Release.Name}} - he`)},
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
v := chartutil.Values{
|
|
|
|
v := chartutil.Values{
|
|
|
|
"Values": "",
|
|
|
|
"Values": "",
|
|
|
|
"Chart": c.Metadata,
|
|
|
|
"Chart": c.Metadata,
|
|
|
@ -477,6 +486,12 @@ func TestAlterFuncMap_include(t *testing.T) {
|
|
|
|
if got := out["conrad/templates/quote"]; got != expect {
|
|
|
|
if got := out["conrad/templates/quote"]; got != expect {
|
|
|
|
t.Errorf("Expected %q, got %q (%v)", expect, got, out)
|
|
|
|
t.Errorf("Expected %q, got %q (%v)", expect, got, out)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
out, err = Render(d, v)
|
|
|
|
|
|
|
|
expectErrName := "nested/templates/quote"
|
|
|
|
|
|
|
|
if err == nil {
|
|
|
|
|
|
|
|
t.Errorf("Expected err of nested reference name: %v", expectErrName)
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func TestAlterFuncMap_require(t *testing.T) {
|
|
|
|
func TestAlterFuncMap_require(t *testing.T) {
|
|
|
|