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
Fix the converts an empty string to nil. #119229
Conversation
Hi @HirazawaUi. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/ok-to-test |
{ | ||
data: "{\"fj\":\"\"}", | ||
obj: &F{}, | ||
}, |
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.
I'm not convinced this is good enough? Did that test fail to pass without the change?
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.
I'm not convinced this is good enough? Did that test fail to pass without the change?
This test will fails without the change, The error message is as follows:
converter_test.go:691: Object changed, diff: &runtime_test.F{
... // 7 identical fields
H: nil,
I: nil,
- J: []uint8{},
+ J: nil,
}
/triage accepted |
Thanks for the follow-through @HirazawaUi - this has been a fun bug to track. After this PR, is the I also approve, but @apelisse holds the LGTM. /approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: HirazawaUi, thockin, wojtek-t 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 |
Yes, the secret issue is solved. |
Thanks |
LGTM label has been added. Git tree hash: 4fcabdc474499726aa407c2143aa83e159e3d1f9
|
The failure is a flake #119244. /test pull-kubernetes-unit |
/retest |
Thank you @HirazawaUi! Do you plan to cherry-pick this PR? |
Okay, I'll do this. |
…119229-upstream-release-1.27 Automated cherry pick of #119229: Fix the converts an empty string to nil.
…119229-upstream-release-1.26 Automated cherry pick of #119229: Fix the converts an empty string to nil.
…119229-upstream-release-1.25 Automated cherry pick of #119229: Fix the converts an empty string to nil.
…119229-upstream-release-1.24 Automated cherry pick of #119229: Fix the converts an empty string to nil.
What type of PR is this?
/kind bug
What this PR does / why we need it:
converter shouldn't transform a "" into a []byte(nil) but into a []byte{}
Which issue(s) this PR fixes:
Fixes #118588
Special notes for your reviewer:
For the detailed discussion, please refer to: #118605 (comment)
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: