|
|
|
@ -28,6 +28,9 @@ func TestShow(t *testing.T) {
|
|
|
|
|
Metadata: &chart.Metadata{Name: "alpine"},
|
|
|
|
|
Files: []*chart.File{
|
|
|
|
|
{Name: "README.md", Data: []byte("README\n")},
|
|
|
|
|
{Name: "crds/ignoreme.txt", Data: []byte("error")},
|
|
|
|
|
{Name: "crds/foo.yaml", Data: []byte("---\nfoo\n")},
|
|
|
|
|
{Name: "crds/bar.json", Data: []byte("---\nbar\n")},
|
|
|
|
|
},
|
|
|
|
|
Raw: []*chart.File{
|
|
|
|
|
{Name: "values.yaml", Data: []byte("VALUES\n")},
|
|
|
|
@ -48,6 +51,12 @@ VALUES
|
|
|
|
|
---
|
|
|
|
|
README
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
foo
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
bar
|
|
|
|
|
|
|
|
|
|
`
|
|
|
|
|
if output != expect {
|
|
|
|
|
t.Errorf("Expected\n%q\nGot\n%q\n", expect, output)
|
|
|
|
@ -83,3 +92,31 @@ func TestShowValuesByJsonPathFormat(t *testing.T) {
|
|
|
|
|
t.Errorf("Expected\n%q\nGot\n%q\n", expect, output)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func TestShowCRDs(t *testing.T) {
|
|
|
|
|
client := NewShow(ShowCRDs)
|
|
|
|
|
client.chart = &chart.Chart{
|
|
|
|
|
Metadata: &chart.Metadata{Name: "alpine"},
|
|
|
|
|
Files: []*chart.File{
|
|
|
|
|
{Name: "crds/ignoreme.txt", Data: []byte("error")},
|
|
|
|
|
{Name: "crds/foo.yaml", Data: []byte("---\nfoo\n")},
|
|
|
|
|
{Name: "crds/bar.json", Data: []byte("---\nbar\n")},
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
output, err := client.Run("")
|
|
|
|
|
if err != nil {
|
|
|
|
|
t.Fatal(err)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
expect := `---
|
|
|
|
|
foo
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
bar
|
|
|
|
|
|
|
|
|
|
`
|
|
|
|
|
if output != expect {
|
|
|
|
|
t.Errorf("Expected\n%q\nGot\n%q\n", expect, output)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|