-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
base: master
Are you sure you want to change the base?
fix(ApplicationSet): Check strategy type to verify it's a progressive sync #22563
Conversation
Signed-off-by: Fernando Crespo Gravalos <fcrespo@fastly.com>
❗ Preview Environment deployment failed on BunnyshellSee: Environment Details | Pipeline Logs Available 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 <fcrespo@fastly.com>
Signed-off-by: Fernando Crespo Gravalos <fcrespo@fastly.com>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #22563 +/- ##
==========================================
+ Coverage 55.96% 56.02% +0.05%
==========================================
Files 343 343
Lines 57527 57531 +4
==========================================
+ Hits 32197 32230 +33
+ Misses 22679 22649 -30
- Partials 2651 2652 +1 ☔ 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? |
@@ -1000,8 +1000,14 @@ func appSyncEnabledForNextStep(appset *argov1alpha1.ApplicationSet, app argov1al | |||
return true | |||
} | |||
|
|||
func isRollingSyncStrategy(appset *argov1alpha1.ApplicationSet) bool { | |||
// It's only RollingSync if it's especifically set by the type |
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.
// It's only RollingSync if it's especifically set by the type | |
// It's only RollingSync if the type specifically sets it |
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. |
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