-
Notifications
You must be signed in to change notification settings - Fork 296
feat: auto migrate kubectl-client-side-apply fields for SSA #727
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
feat: auto migrate kubectl-client-side-apply fields for SSA #727
Conversation
Signed-off-by: Peter Jiang <peterjiang823@gmail.com>
Signed-off-by: Peter Jiang <peterjiang823@gmail.com>
Signed-off-by: Peter Jiang <peterjiang823@gmail.com>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #727 +/- ##
==========================================
- Coverage 54.26% 53.42% -0.84%
==========================================
Files 64 64
Lines 6164 6560 +396
==========================================
+ Hits 3345 3505 +160
- Misses 2549 2777 +228
- Partials 270 278 +8 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
@pjiang-dev @crenshaw-dev could we not do something similar as kubernetes/kubernetes#124191 where we'd force ownership of all fields, given that we opt-in to this behavior by adding another sync option? Something like |
@blakepettersson That PR works by manipulating managed fields and adds the ' However, i do think what we can do is provide an additional annotation with SSA that allows users to specify their own field manager to migrate fields. This would replace the 'kubectl-client-side-apply' field manager in this PR with their own with something like this: |
Sounds good to me! Could we have that option for multiple field managers, e.g
(the default still being |
Unfortunately, we cannot do multiple field managers at once because 'last-applied-configuration' can only belong to one field manager at a time without manipulating managed fields. I think it won't be too much burden for users to just change the manager and re-sync if they have multiple managers though. |
Signed-off-by: Peter Jiang <peterjiang823@gmail.com>
For this PR i will leave as is and create a follow up PR to make the field manager to migrate fields configurable to the user |
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.
For this PR i will leave as is and create a follow up PR to make the field manager to migrate fields configurable to the user
I think the only thing missing in this PR is the ability to turn this feature on/off
Signed-off-by: Peter Jiang <peterjiang823@gmail.com>
Added option to disable this migration using this annotation in argocd:
|
Signed-off-by: Peter Jiang <peterjiang823@gmail.com>
Signed-off-by: Peter Jiang <peterjiang823@gmail.com>
Signed-off-by: Peter Jiang <peterjiang823@gmail.com>
Signed-off-by: Peter Jiang <peterjiang823@gmail.com>
Signed-off-by: Peter Jiang <peterjiang823@gmail.com>
|
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
…#727) * feat: auto migrate kubectl-client-side-apply fields for SSA Signed-off-by: Peter Jiang <peterjiang823@gmail.com> * fix master version Signed-off-by: Peter Jiang <peterjiang823@gmail.com> * run gofumpt Signed-off-by: Peter Jiang <peterjiang823@gmail.com> * Propagate sync error instead of logging Signed-off-by: Peter Jiang <peterjiang823@gmail.com> * allow enable/disable of CSA migration using annotation Signed-off-by: Peter Jiang <peterjiang823@gmail.com> * fix linting Signed-off-by: Peter Jiang <peterjiang823@gmail.com> * Refactor to allow for multiple managers and disable option Signed-off-by: Peter Jiang <peterjiang823@gmail.com> * remove commentj Signed-off-by: Peter Jiang <peterjiang823@gmail.com> * refactor Signed-off-by: Peter Jiang <peterjiang823@gmail.com> * fix test Signed-off-by: Peter Jiang <peterjiang823@gmail.com> * Add docs for client side apply migration Signed-off-by: Peter Jiang <peterjiang823@gmail.com> * Edit comment Signed-off-by: Peter Jiang <peterjiang823@gmail.com> --------- Signed-off-by: Peter Jiang <peterjiang823@gmail.com> Signed-off-by: Roelof Kuijpers <roelof.kuijpers@energyessentials.nl>
fixes argoproj/argo-cd#23214
When performing a Sync with ServerSideApply we will check if there is a
kubectl-client-side-apply
manager and run a client side apply with the field managerkubectl-client-side-apply
. This will make thelast-applied-confiugration
field to be owned bykubectl-client-side-apply
and then once the Sync with ServerSideApply executes it will trigger the auto-migration of fields to argocd-controller which is described in kubernetes/kubernetes#112905We need this in cases where a user created their resource with
kubectl apply -f
in the command line then later used argocd to manage it with SSA.There will be a PR in argo-cd to support configurable field managers to migration from as well as option to disable this feature entirely