advancedxy commented on code in PR #1630:
URL:
https://github.com/apache/incubator-uniffle/pull/1630#discussion_r1566800097
##########
deploy/kubernetes/operator/pkg/webhook/util/util.go:
##########
@@ -158,12 +159,30 @@ func NeedInspectPod(pod *corev1.Pod) bool {
return false
}
+// JSONFloat is used to parse the float64 which may be NaN
+type JSONFloat float64
+
+// UnmarshalJSON return the parsed JSONFloat
+func (j *JSONFloat) UnmarshalJSON(v []byte) error {
Review Comment:
Yeah, I know `MarshalJson` is not used here right now. But it might be used
in the operator in the future for various reasons. It would be surprise or
cause response failure in the operator when potentially serializing float with
NaN. Since we already support deserializing float with NaN, I think it would
nice to add serialize support to avoid any potential gochas.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]