Skip to content

Commit

Permalink
Treat empty string as nil in fuzzer for CEL Reason field
Browse files Browse the repository at this point in the history
Kubernetes-commit: 22bf29ad22f2889643b17305bf30d585a425d3a5
  • Loading branch information
jpbetz authored and k8s-publishing-bot committed Jul 24, 2023
1 parent ce3ed21 commit d60d893
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/apis/apiextensions/fuzzer/fuzzer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
},
}
}

0 comments on commit d60d893

Please sign in to comment.