|
|
@ -35,6 +35,7 @@ const badYamlFileDir = "rules/testdata/albatross"
|
|
|
|
const goodChartDir = "rules/testdata/goodone"
|
|
|
|
const goodChartDir = "rules/testdata/goodone"
|
|
|
|
const subChartValuesDir = "rules/testdata/withsubchart"
|
|
|
|
const subChartValuesDir = "rules/testdata/withsubchart"
|
|
|
|
const malformedTemplate = "rules/testdata/malformed-template"
|
|
|
|
const malformedTemplate = "rules/testdata/malformed-template"
|
|
|
|
|
|
|
|
const invalidChartFileDir = "rules/testdata/invalidchartfile"
|
|
|
|
|
|
|
|
|
|
|
|
func TestBadChart(t *testing.T) {
|
|
|
|
func TestBadChart(t *testing.T) {
|
|
|
|
m := RunAll(badChartDir, values, namespace).Messages
|
|
|
|
m := RunAll(badChartDir, values, namespace).Messages
|
|
|
@ -90,6 +91,16 @@ func TestInvalidYaml(t *testing.T) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func TestInvalidChartYaml(t *testing.T) {
|
|
|
|
|
|
|
|
m := RunAll(invalidChartFileDir, values, namespace).Messages
|
|
|
|
|
|
|
|
if len(m) != 1 {
|
|
|
|
|
|
|
|
t.Fatalf("All didn't fail with expected errors, got %#v", m)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if !strings.Contains(m[0].Err.Error(), "failed to strictly parse chart metadata file") {
|
|
|
|
|
|
|
|
t.Errorf("All didn't have the error for duplicate YAML keys")
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func TestBadValues(t *testing.T) {
|
|
|
|
func TestBadValues(t *testing.T) {
|
|
|
|
m := RunAll(badValuesFileDir, values, namespace).Messages
|
|
|
|
m := RunAll(badValuesFileDir, values, namespace).Messages
|
|
|
|
if len(m) < 1 {
|
|
|
|
if len(m) < 1 {
|
|
|
|