-
Notifications
You must be signed in to change notification settings - Fork 39.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove incomplete uint64 support from JSON unmarshaling #62981
Conversation
/retest |
1 similar comment
/retest |
/assign deads2k |
/assign @liggitt For json crazy. |
@@ -120,7 +120,7 @@ func keepOrDeleteNullInObj(m map[string]interface{}, keepNull bool) (map[string] | |||
if err != nil { | |||
return nil, err | |||
} | |||
case []interface{}, string, float64, bool, int, int64, nil: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dropping uint handling makes sense, but I don't see the need to change this here
@@ -125,7 +125,7 @@ func HasConflicts(left, right interface{}) (bool, error) { | |||
default: | |||
return true, nil | |||
} | |||
case string, float64, bool, int, int64, nil: | |||
case string, float64, bool, int64, nil: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here, I would restore this
@@ -1876,7 +1876,7 @@ func mergingMapFieldsHaveConflicts( | |||
return true, nil | |||
} | |||
return slicesHaveConflicts(leftType, rightType, schema, fieldPatchStrategy, fieldPatchMergeKey) | |||
case string, float64, bool, int, int64, nil: | |||
case string, float64, bool, int64, nil: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
restore this
please limit this change to the removal of uint handling... can put the removal of unsized ints in a separate PR if you want, and we can think about what benefits that provides separately |
@liggitt they are not used - as you can see, tests pass without them. That code works with unmarshaled JSON which is |
|
@liggitt I've removed the change. PTAL |
/lgtm |
@deads2k PTAL |
/retest |
/lgtm |
/assign @lavalamp |
@@ -438,13 +437,15 @@ func (c *unstructuredConverter) ToUnstructured(obj interface{}) (map[string]inte | |||
} | |||
|
|||
// DeepCopyJSON deep copies the passed value, assuming it is a valid JSON representation i.e. only contains | |||
// types produced by json.Unmarshal(). | |||
// types produced by json.Unmarshal() and also int64. | |||
// bool, int64, float64, string, []interface{}, map[string]interface{}, json.Number and nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this an enumeration of "types produced by json.Unmarshal() and also int64" ?
nit: put a :
behind the previous sentence.
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ash2k, liggitt, sttts, yliaog The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/test all [submit-queue is verifying that this PR is safe to merge] |
Automatic merge from submit-queue (batch tested with PRs 61154, 62981). If you want to cherry-pick this change to another branch, please follow the instructions here. |
Automatic merge from submit-queue (batch tested with PRs 65094, 65533, 63522, 65694, 65702). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. Remove int support from json patches **What this PR does / why we need it**: JSON only contains `int64` and `float64` types for numbers so `int` is not needed. **Special notes for your reviewer**: This is a follow up for #62981. **Release note**: ```release-note NONE ``` /sig api-machinery /kind cleanup /cc liggitt sttts
Automatic merge from submit-queue (batch tested with PRs 65094, 65533, 63522, 65694, 65702). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. Remove int support from json patches **What this PR does / why we need it**: JSON only contains `int64` and `float64` types for numbers so `int` is not needed. **Special notes for your reviewer**: This is a follow up for kubernetes/kubernetes#62981. **Release note**: ```release-note NONE ``` /sig api-machinery /kind cleanup /cc liggitt sttts Kubernetes-commit: 74b764224a1dccdeee4b995e9b717ce9168d92e1
What this PR does / why we need it:
Removes
uint64
support from JSON unmarshaling because:Which issue(s) this PR fixes
Fixes #62769.
Special notes for your reviewer:
This is an alternative approach to #62775.
Release note:
/kind bug
/sig api-machinery
/cc @sttts