fix fuzzer for hostpath type that the path can be an empty string

This commit is contained in:
Di Xu 2017-08-24 17:24:04 +08:00
parent b2f3244032
commit 2fd25b6796

View File

@ -360,7 +360,7 @@ var Funcs = func(codecs runtimeserializer.CodecFactory) []interface{} {
types := []api.HostPathType{api.HostPathUnset, api.HostPathDirectoryOrCreate, api.HostPathDirectory,
api.HostPathFileOrCreate, api.HostPathFile, api.HostPathSocket, api.HostPathCharDev, api.HostPathBlockDev}
typeVol := types[c.Rand.Intn(len(types))]
if obj.Path != "" && obj.Type == nil {
if obj.Type == nil {
obj.Type = &typeVol
}
},