-
Notifications
You must be signed in to change notification settings - Fork 196
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
Use Update (PUT) not Patch when modifying spec and status #1674
Conversation
b7c017a
to
03c3375
Compare
Note: There are lots more refactors that we need to do to |
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.
PATCHing means that we don't know for sure the state of the resource after the PATCH (because it might have been a different version than we thought). PATCHing also makes removal of fields difficult, which is especially important in places like Status where there's no telling what can come or go from reconcile loop iteration N to iteration N+1.
It's significantly more complex than we need for our use case
03c3375
to
96c7052
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.
Codecov Report
@@ Coverage Diff @@
## master #1674 +/- ##
==========================================
- Coverage 67.98% 67.98% -0.01%
==========================================
Files 212 210 -2
Lines 15151 15076 -75
==========================================
- Hits 10300 10249 -51
+ Misses 4082 4069 -13
+ Partials 769 758 -11
Continue to review full report at Codecov.
|
* Use PUT not PATCH for all k8s resource updates PATCHing means that we don't know for sure the state of the resource after the PATCH (because it might have been a different version than we thought). PATCHing also makes removal of fields difficult, which is especially important in places like Status where there's no telling what can come or go from reconcile loop iteration N to iteration N+1. * Remove util/patch It's significantly more complex than we need for our use case
* Use PUT not PATCH for all k8s resource updates PATCHing means that we don't know for sure the state of the resource after the PATCH (because it might have been a different version than we thought). PATCHing also makes removal of fields difficult, which is especially important in places like Status where there's no telling what can come or go from reconcile loop iteration N to iteration N+1. * Remove util/patch It's significantly more complex than we need for our use case
What this PR does / why we need it:
Patch has a number of issues:
Rather than fight with Patch, moved to use Update (full replace) everywhere. As part of this work also refactored a little to make the controller more deterministic.
How does this PR make you feel:
If applicable: