-
Notifications
You must be signed in to change notification settings - Fork 298
feat: auto migrate kubectl-client-side-apply fields for SSA #727
feat: auto migrate kubectl-client-side-apply fields for SSA #727
Conversation
Signed-off-by: Peter Jiang <[email protected]>
Signed-off-by: Peter Jiang <[email protected]>
Signed-off-by: Peter Jiang <[email protected]>
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 <[email protected]>
|
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 <[email protected]>
Added option to disable this migration using this annotation in argocd: |
Signed-off-by: Peter Jiang <[email protected]>
Signed-off-by: Peter Jiang <[email protected]>
Signed-off-by: Peter Jiang <[email protected]>
Signed-off-by: Peter Jiang <[email protected]>
Signed-off-by: Peter Jiang <[email protected]>
Signed-off-by: Peter Jiang <[email protected]>
Signed-off-by: Peter Jiang <[email protected]>
|
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 <[email protected]> * fix master version Signed-off-by: Peter Jiang <[email protected]> * run gofumpt Signed-off-by: Peter Jiang <[email protected]> * Propagate sync error instead of logging Signed-off-by: Peter Jiang <[email protected]> * allow enable/disable of CSA migration using annotation Signed-off-by: Peter Jiang <[email protected]> * fix linting Signed-off-by: Peter Jiang <[email protected]> * Refactor to allow for multiple managers and disable option Signed-off-by: Peter Jiang <[email protected]> * remove commentj Signed-off-by: Peter Jiang <[email protected]> * refactor Signed-off-by: Peter Jiang <[email protected]> * fix test Signed-off-by: Peter Jiang <[email protected]> * Add docs for client side apply migration Signed-off-by: Peter Jiang <[email protected]> * Edit comment Signed-off-by: Peter Jiang <[email protected]> --------- Signed-off-by: Peter Jiang <[email protected]> Signed-off-by: Roelof Kuijpers <[email protected]>



fixes argoproj/argo-cd#23214
When performing a Sync with ServerSideApply we will check if there is a
kubectl-client-side-applymanager and run a client side apply with the field managerkubectl-client-side-apply. This will make thelast-applied-confiugrationfield to be owned bykubectl-client-side-applyand 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 -fin 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