-
Notifications
You must be signed in to change notification settings - Fork 38.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #44026 from nikinath/precision-json
Automatic merge from submit-queue (batch tested with PRs 44424, 44026, 43939, 44386, 42914) Preserve int data when unmarshalling for TPR **What this PR does / why we need it**: The Go json package converts all numbers to float64 while unmarshalling. This exposes many of the int64 fields to corruption when marshalled back to json. The json package provided by kubernetes also provides a way to defer conversion of numbers (https://golang.org/pkg/encoding/json/#Decoder.UseNumber) and does the conversions to int or float. This is also implemented in the custom json package. See: (https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/apimachinery/pkg/util/json/json.go) Now, the number is preserved as an integer till the highest int64 number - `9223372036854775807`. **Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #30213 **Special notes for your reviewer**: See also #16964 **Release note**: ``` NONE ```
- Loading branch information
Showing
3 changed files
with
51 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters