|
|
|
|
@ -1072,28 +1072,32 @@ func TestInstallRun_UnreachableKubeClient(t *testing.T) {
|
|
|
|
|
|
|
|
|
|
func TestInstallCRDs_CheckNilErrors(t *testing.T) {
|
|
|
|
|
tests := []struct {
|
|
|
|
|
name string
|
|
|
|
|
input []chart.CRD
|
|
|
|
|
name string
|
|
|
|
|
input []chart.CRD
|
|
|
|
|
expectedErr bool
|
|
|
|
|
}{
|
|
|
|
|
{
|
|
|
|
|
name: "only one crd with file nil",
|
|
|
|
|
input: []chart.CRD{
|
|
|
|
|
{Name: "one", File: nil},
|
|
|
|
|
},
|
|
|
|
|
expectedErr: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "only one crd with its file data nil",
|
|
|
|
|
input: []chart.CRD{
|
|
|
|
|
{Name: "one", File: &common.File{Name: "crds/foo.yaml", Data: nil}},
|
|
|
|
|
},
|
|
|
|
|
expectedErr: false,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "at least a crd with its file data nil",
|
|
|
|
|
input: []chart.CRD{
|
|
|
|
|
{Name: "one", File: &common.File{Name: "crds/foo.yaml", Data: []byte("data")}},
|
|
|
|
|
{Name: "two", File: &common.File{Name: "crds/foo.yaml", Data: nil}},
|
|
|
|
|
{Name: "three", File: &common.File{Name: "crds/foo.yaml", Data: []byte("data")}},
|
|
|
|
|
{Name: "two", File: &common.File{Name: "crds/foo2.yaml", Data: nil}},
|
|
|
|
|
{Name: "three", File: &common.File{Name: "crds/foo3.yaml", Data: []byte("data")}},
|
|
|
|
|
},
|
|
|
|
|
expectedErr: false,
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -1102,8 +1106,8 @@ func TestInstallCRDs_CheckNilErrors(t *testing.T) {
|
|
|
|
|
instAction := installAction(t)
|
|
|
|
|
|
|
|
|
|
err := instAction.installCRDs(tt.input)
|
|
|
|
|
if err == nil {
|
|
|
|
|
t.Errorf("got error expected nil")
|
|
|
|
|
if tt.expectedErr && err == nil {
|
|
|
|
|
t.Errorf("got error %v expected nil", err)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|