Check for an empty value in validateField

reflect.TypeOf() can take a nil (it then returns a nil), but
Kind() panics on a nil.

Fixes #20627
This commit is contained in:
Angus Salkeld
2016-05-30 14:01:38 +10:00
parent 77de942e08
commit 5dcbc7ce5b
5 changed files with 51 additions and 1 deletions

View File

@@ -209,6 +209,7 @@ func TestInvalid(t *testing.T) {
"invalidPod1.json", // command is a string, instead of []string.
"invalidPod2.json", // hostPort if of type string, instead of int.
"invalidPod3.json", // volumes is not an array of objects.
"invalidPod4.yaml", // string list with empty string.
"invalidPod.yaml", // command is a string, instead of []string.
}
for _, test := range tests {