-
Notifications
You must be signed in to change notification settings - Fork 38.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
Fix proto.Merge of IntOrString type #83956
Conversation
cc @BenTheElder /retest |
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.
Thanks!
@liggitt thanks - this is kubernetes-sigs/kind#949, it's happening very rarely and I've not been able to replicate it in a controlled environment yet, seems like possibly a docker issue :( https://prow.k8s.io/?job=pull-kubernetes-e2e-kind - 93% / 92% / 79 % passing for the past 3 / 12 / 48 hours, the failing runs are generally bad commits (EG code that doesn't compile). |
func TestIntstr(t *testing.T) { | ||
x := FromString("1") | ||
y := FromString("2") | ||
proto.Merge(&x, &y) |
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.
Do we generally support proto.Merge? What are people using this for? What is the result of this operation?
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.
We are using proto.Clone
which seems to call proto.Merge at some point in the call tree
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.
Why are you using that rather than the DeepCopy functions we generate? (assuming it does the same thing?)
I don't object to this change, but I am not at all sure I want to sign up for promising that proto.Merge works on all of our objects; we don't test it AFAIK, I have no idea if it does the right thing. |
agree, I care more about this because all serialized primitive fields should be sized (even though practically this field value would only be |
But... Type is not serialized? |
It is in proto.
kubernetes/staging/src/k8s.io/apimachinery/pkg/util/intstr/generated.pb.go Lines 195 to 213 in cb3b715
|
ew. hm. OK. Is there a way to test this that won't imply to people that we expect proto.Merge to function everywhere? |
other than dropping the proto.Merge test or adding a comment to that effect, not that I can think of... preference? |
Either of those is fine with me.
…On Tue, Oct 15, 2019 at 2:01 PM Jordan Liggitt ***@***.***> wrote:
Is there a way to test this that won't imply to people that we expect
proto.Merge to function everywhere?
other than dropping the proto.Merge test or adding a comment to that
effect, not that I can think of... preference?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#83956?email_source=notifications&email_token=AAE6BFSAR2TRCYRQIDHEZWTQOYVSVA5CNFSM4JA6HVY2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBKGK4I#issuecomment-542401905>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAE6BFWV2F34O7DRISVMGSLQOYVSVANCNFSM4JA6HVYQ>
.
|
dropped the proto.Merge test |
/priority backlog |
/lgtm (I can't believe I asked you to remove a test, sigh... ;) ) |
I know... where is Daniel and what have you done with him? |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: lavalamp, liggitt 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 |
/retest Review the full test history for this PR. Silence the bot with an |
…6-upstream-release-1.16 Automated cherry pick of #83956: Fix proto.Merge of IntOrString type
What type of PR is this?
/kind bug
What this PR does / why we need it:
The unsized int in the IntOrString type breaks proto.Merge. The proto serialization was already using int64, and json serialization used custom marshaling, so this doesn't change serialization at all.
Which issue(s) this PR fixes:
Fixes #83912
Does this PR introduce a user-facing change?:
/sig api-machinery
/cc @smarterclayton