-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
🐛 Ensure status updates succeed #1261
🐛 Ensure status updates succeed #1261
Conversation
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.
some minor nits around the comment, otherwise lgtm.
I suspect the MachineSet and MachineDeployment controllers will also need to be updated as well.
29a0e2b
to
e8e70d9
Compare
e8e70d9
to
a029032
Compare
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: chuckha, vincepri 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 |
@@ -49,4 +50,37 @@ var _ = Describe("Cluster Reconciler", func() { | |||
}, timeout).Should(BeTrue()) | |||
}) | |||
|
|||
It("Should patch the status even if the spec is empty", func() { |
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.
Could we also add some tests around patchCluster
to verify the edge cases there?
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.
Ah, that message needs improvement.
It does both update status if spec is empty and update spec if status is empty.
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.
If that's not satisfactory can you please tell me which edge cases you'd like tests for?
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'd split it in 2 parts :)
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.
haha i just went the opposite route and made the test name very generic. I can do two different tests if you like though
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 was thinking of the following three scenarios:
- Only status updated
- Only non-status updated
- Both updated
Tested independently to ensure we see the expected changes reflected in the resulting object.
ed9fed4
to
7d51b86
Compare
@vincepri updated to two separate tests |
7d51b86
to
f810e7b
Compare
Signed-off-by: Chuck Ha <chuckh@vmware.com>
f810e7b
to
f4f51a8
Compare
@detiber rebase fixed and all 3 cases are covered by tests. PTAL |
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
Signed-off-by: Chuck Ha chuckh@vmware.com
What this PR does / why we need it:
This PR is a work around for #1259.
It also removes an outdated hack in the machine-update code that is no longer needed as of controller-runtime beta.5
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):This can be fixed in controller-runtime but until that fix is in this hack will be in place.
Special notes for your reviewer:
Release note:
/assign @detiber @vincepri