Signed-off-by: Helgi Þorbjörnsson <helgith@gmail.com>
pull/4748/head
Helgi Þorbjörnsson 7 years ago
parent e8dfb29dd8
commit 1089a3b597

@ -466,7 +466,6 @@ func TestAlterFuncMap(t *testing.T) {
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }
expectStr := "All your base are belong to us" expectStr := "All your base are belong to us"
if gotStr := outReq["conan/templates/quote"]; gotStr != expectStr { if gotStr := outReq["conan/templates/quote"]; gotStr != expectStr {
t.Errorf("Expected %q, got %q (%v)", expectStr, gotStr, outReq) t.Errorf("Expected %q, got %q (%v)", expectStr, gotStr, outReq)
@ -476,6 +475,32 @@ func TestAlterFuncMap(t *testing.T) {
t.Errorf("Expected %q, got %q (%v)", expectNum, gotNum, outReq) t.Errorf("Expected %q, got %q (%v)", expectNum, gotNum, outReq)
} }
// test required without passing in needed values with lint mode on
// verifies lint replaces required with an empty string (should not fail)
lintValues := chartutil.Values{
"Values": chartutil.Values{
"who": "us",
},
"Chart": reqChart.Metadata,
"Release": chartutil.Values{
"Name": "That 90s meme",
},
}
e := New()
e.LintMode = true
outReq, err = e.Render(reqChart, lintValues)
if err != nil {
t.Fatal(err)
}
expectStr = "All your base are belong to us"
if gotStr := outReq["conan/templates/quote"]; gotStr != expectStr {
t.Errorf("Expected %q, got %q (%v)", expectStr, gotStr, outReq)
}
expectNum = "All of them!"
if gotNum := outReq["conan/templates/bases"]; gotNum != expectNum {
t.Errorf("Expected %q, got %q (%v)", expectNum, gotNum, outReq)
}
tplChart := &chart.Chart{ tplChart := &chart.Chart{
Metadata: &chart.Metadata{Name: "TplFunction"}, Metadata: &chart.Metadata{Name: "TplFunction"},
Templates: []*chart.Template{ Templates: []*chart.Template{

Loading…
Cancel
Save