Bumping k8s dependencies to 1.13

This commit is contained in:
Cheng Xing
2018-11-16 14:08:25 -08:00
parent 305407125c
commit b4c0b68ec7
8002 changed files with 884099 additions and 276228 deletions

View File

@@ -31,12 +31,14 @@ func TestQuotaGenerate(t *testing.T) {
t.Errorf("unexpected error: %v", err)
}
tests := map[string]struct {
tests := []struct {
name string
params map[string]interface{}
expected *v1.ResourceQuota
expectErr bool
}{
"test-valid-use": {
{
name: "test-valid-use",
params: map[string]interface{}{
"name": "foo",
"hard": hard,
@@ -49,13 +51,15 @@ func TestQuotaGenerate(t *testing.T) {
},
expectErr: false,
},
"test-missing-required-param": {
{
name: "test-missing-required-param",
params: map[string]interface{}{
"name": "foo",
},
expectErr: true,
},
"test-valid-scopes": {
{
name: "test-valid-scopes",
params: map[string]interface{}{
"name": "foo",
"hard": hard,
@@ -75,7 +79,8 @@ func TestQuotaGenerate(t *testing.T) {
},
expectErr: false,
},
"test-empty-scopes": {
{
name: "test-empty-scopes",
params: map[string]interface{}{
"name": "foo",
"hard": hard,
@@ -89,7 +94,8 @@ func TestQuotaGenerate(t *testing.T) {
},
expectErr: false,
},
"test-invalid-scopes": {
{
name: "test-invalid-scopes",
params: map[string]interface{}{
"name": "foo",
"hard": hard,
@@ -100,16 +106,18 @@ func TestQuotaGenerate(t *testing.T) {
}
generator := ResourceQuotaGeneratorV1{}
for name, test := range tests {
obj, err := generator.Generate(test.params)
if !test.expectErr && err != nil {
t.Errorf("%s: unexpected error: %v", name, err)
}
if test.expectErr && err != nil {
continue
}
if !reflect.DeepEqual(obj.(*v1.ResourceQuota), test.expected) {
t.Errorf("%s:\nexpected:\n%#v\nsaw:\n%#v", name, test.expected, obj.(*v1.ResourceQuota))
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
obj, err := generator.Generate(tt.params)
if !tt.expectErr && err != nil {
t.Errorf("%s: unexpected error: %v", tt.name, err)
}
if tt.expectErr && err != nil {
return
}
if !reflect.DeepEqual(obj.(*v1.ResourceQuota), tt.expected) {
t.Errorf("%s:\nexpected:\n%#v\nsaw:\n%#v", tt.name, tt.expected, obj.(*v1.ResourceQuota))
}
})
}
}