Merge pull request #119543 from jpbetz/fix-xvalidations-flake

Treat empty string as nil in fuzzer for CEL Reason field
This commit is contained in:
Kubernetes Prow Robot 2023-07-24 14:10:12 -07:00 committed by GitHub
commit 33b63f5715
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -181,5 +181,11 @@ func Funcs(codecs runtimeserializer.CodecFactory) []interface{} {
// JSON only supports 53 bits because everything is a float
*obj = int64(c.Uint64()) & ((int64(1) << 53) - 1)
},
func(obj *apiextensions.ValidationRule, c fuzz.Continue) {
c.FuzzNoCustom(obj)
if obj.Reason != nil && *(obj.Reason) == "" {
obj.Reason = nil
}
},
}
}