-
Notifications
You must be signed in to change notification settings - Fork 5.9k
fix(ApplicationSet): Check strategy type to verify it's a progressive sync #22563
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
fix(ApplicationSet): Check strategy type to verify it's a progressive sync #22563
Conversation
Signed-off-by: Fernando Crespo Gravalos <[email protected]>
❌ Preview Environment deleted from BunnyshellAvailable commands (reply to this comment):
|
@fcrespofastly thanks for the PR! some build and linting errors need to be addressed. Additionally, please add some tests, especially one that reproduces the bug. |
Yola |
Hey folks! Just a quick not to let you know that I'm still working on it last week with ArgoCon and KubeCon was a bit busy, so didn't have much time to work on this. |
Signed-off-by: Fernando Crespo Gravalos <[email protected]>
Signed-off-by: Fernando Crespo Gravalos <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #22563 +/- ##
==========================================
+ Coverage 56.05% 56.10% +0.04%
==========================================
Files 343 343
Lines 57547 57551 +4
==========================================
+ Hits 32259 32288 +29
+ Misses 22643 22624 -19
+ Partials 2645 2639 -6 ☔ View full report in Codecov by Sentry. |
Hey @rumstead 👋🏻 Updated the PR and added some tests. Let me know what you think. Does all of this make sense to you? |
The code and tests make sense, I think it would be great if we can reproduce the bug via the reconcile loop and have a test that fails before your change and passes after. the current tests pass before and after your change. |
Yeah I've been looking into it as well, it's just going to be tricky. To be clear with my change nothing should fail, it should still reconcile but not in a progressive sync fashion if not explicitly set. |
Hey @rumstead ! Sorry for getting back to this late, being a few (good) days off ! Back to you comment I'm not sure how can I provide the tests you're asking. So I do appreciate if you can shed some light 💡 The bug this solves is an infinite reconciliation loop when the strategy type is set to Happy to discuss this further. |
You can validate that progressive syncs doesn't happen when the |
Ok, I was playing around with this today, and it seems too complicated to be worth it. I just have a few nits on comment verbiage, otherwise LGTM. |
Add @rumstead suggestion Co-authored-by: rumstead <[email protected]> Signed-off-by: Fernando Crespo Grávalos <[email protected]>
Hey @rumstead! Thanks for the review! much appreciated! Added your suggestion, not sure if there is anything else you wanted me to tackle/revisit? |
… sync (argoproj#22563) Signed-off-by: Fernando Crespo Gravalos <[email protected]> Signed-off-by: Fernando Crespo Grávalos <[email protected]> Co-authored-by: rumstead <[email protected]> Signed-off-by: Hapshanko <[email protected]>
@rumstead is it possible to cherry pick this fix to the current version v2.14? |
/cherry-pick release-2.14 |
… sync (#22563) Signed-off-by: Fernando Crespo Gravalos <[email protected]> Signed-off-by: Fernando Crespo Grávalos <[email protected]> Co-authored-by: rumstead <[email protected]>
… sync (cherry-pick #22563) (#22833) Signed-off-by: Fernando Crespo Gravalos <[email protected]> Signed-off-by: Fernando Crespo Grávalos <[email protected]> Co-authored-by: Fernando Crespo Grávalos <[email protected]> Co-authored-by: rumstead <[email protected]>
Checklist:
Description
From ArgoCD
Progressive-Syncs
manual argocd supports two strategies for applicationSets,AllAtOnce
orRollingSync
. BeingAllAtOnce
the default when no strategy is selected.On the other hand, it seems that within the appset controller logic, there's a path in the code: https://github.com/argoproj/argo-cd/blob/master/applicationset/controllers/applicationset_controller.go#L213-L225
Where we do not check exhaustively the strategy type and thus:
Can cause an infinite reconciliation loop. See:
#14712
#22558