mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-03 17:30:00 +00:00
fix fuzzer for hostpath type that the path can be an empty string
This commit is contained in:
parent
b2f3244032
commit
2fd25b6796
@ -360,7 +360,7 @@ var Funcs = func(codecs runtimeserializer.CodecFactory) []interface{} {
|
|||||||
types := []api.HostPathType{api.HostPathUnset, api.HostPathDirectoryOrCreate, api.HostPathDirectory,
|
types := []api.HostPathType{api.HostPathUnset, api.HostPathDirectoryOrCreate, api.HostPathDirectory,
|
||||||
api.HostPathFileOrCreate, api.HostPathFile, api.HostPathSocket, api.HostPathCharDev, api.HostPathBlockDev}
|
api.HostPathFileOrCreate, api.HostPathFile, api.HostPathSocket, api.HostPathCharDev, api.HostPathBlockDev}
|
||||||
typeVol := types[c.Rand.Intn(len(types))]
|
typeVol := types[c.Rand.Intn(len(types))]
|
||||||
if obj.Path != "" && obj.Type == nil {
|
if obj.Type == nil {
|
||||||
obj.Type = &typeVol
|
obj.Type = &typeVol
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user