-
Notifications
You must be signed in to change notification settings - Fork 69
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
Simplify managed fields upgrade from CSA to SSA #319
Simplify managed fields upgrade from CSA to SSA #319
Conversation
Skipping CI for Draft Pull Request. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
199b81c
to
8cf4122
Compare
/test all |
Signed-off-by: Erik Godding Boye <egboye@gmail.com>
8cf4122
to
f7403b7
Compare
/unhold |
/test pull-trust-manager-verify |
Thanks @erikgb. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: inteon 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 |
if !needsUpdate { | ||
return false, nil | ||
if patch != nil { | ||
return true, b.client.Patch(ctx, obj, client.RawPatch(types.JSONPatchType, patch)) |
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.
This is quite a neat trick: instead of update, patch (JSON instead of ssa) is used so there is no extra rbac necessary.
This PR simplifies the upgrade from CSA to SSA by using the helper provided by upstream Kubernetes and also used by
kubectl
. There is a theoretical change in behavior when upgrading after this PR, since the helper does not take the target configmap key into account when upgrading. Which means there could potentially be another operator/controller using the c/r regression field manager. I still think the simplification of code and RBAC is worth this minor risk.