mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-30 15:05:27 +00:00
Merge pull request #51258 from dixudx/fix_hostpath_fuzzer
Automatic merge from submit-queue fix fuzzer for hostpath type that the path can be an empty string **What this PR does / why we need it**: It seems the path of `HostPath` generated by fuzzer can be an empty string. This is causing [pull-kubernetes-unit](https://k8s-gubernator.appspot.com/builds/kubernetes-jenkins/pr-logs/directory/pull-kubernetes-unit) failing. **Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #51260 **Special notes for your reviewer**: /assign @thockin @luxas @ixdy **Release note**: ```release-note None ```
This commit is contained in:
commit
657db0eae7
@ -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
|
||||
}
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user