-
Notifications
You must be signed in to change notification settings - Fork 183
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: ensure NillableDuration is round-trippable #1545
fix: ensure NillableDuration is round-trippable #1545
Conversation
0c9cc81
to
d704fb2
Compare
d704fb2
to
08b1580
Compare
Pull Request Test Coverage Report for Build 10323210198Details
💛 - Coveralls |
08b1580
to
de4365f
Compare
14e0a2b
to
15e5a6c
Compare
15e5a6c
to
97bb0cd
Compare
duration := NillableDuration{} | ||
Expect(json.Unmarshal([]byte(str), &duration)).Should(Succeed()) | ||
*field() = duration | ||
Expect(v1nodepool.ConvertTo(ctx, v1beta1nodepool)).To(Succeed()) |
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.
Just validating: This test failed prior to this 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.
Also, any reason to not json marshal the entire object rather than just the specific field that we care about during the test? Seems like a stronger bar to hold if we do that
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.
Yep, this failed before. I was only marshaling this as json to ensure we populated the "raw" value correctly before doing the conversions, I've updated every instance of us creating a NillableDuration with a constructor that covers this instead.
b67ec92
to
324c516
Compare
46a825a
to
dda7da2
Compare
dda7da2
to
7527dc9
Compare
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.
one comment but LGTM
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.
/lgtm
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jmdeal, njtran 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 |
Co-authored-by: Nick Tran <10810510+njtran@users.noreply.github.com>
Co-authored-by: Nick Tran <10810510+njtran@users.noreply.github.com>
Co-authored-by: Nick Tran <10810510+njtran@users.noreply.github.com>
Co-authored-by: Nick Tran <10810510+njtran@users.noreply.github.com>
Co-authored-by: Nick Tran <10810510+njtran@users.noreply.github.com>
Co-authored-by: Nick Tran <10810510+njtran@users.noreply.github.com>
Co-authored-by: Nick Tran <10810510+njtran@users.noreply.github.com>
Co-authored-by: Nick Tran <10810510+njtran@users.noreply.github.com>
Co-authored-by: Nick Tran <10810510+njtran@users.noreply.github.com>
Co-authored-by: Nick Tran <10810510+njtran@users.noreply.github.com>
Co-authored-by: Nick Tran <10810510+njtran@users.noreply.github.com>
Co-authored-by: Nick Tran <10810510+njtran@users.noreply.github.com>
Fixes #N/A
Description
Ensure our NillableDuration type is round-trippable for conversion webhooks.
How was this change tested?
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.