-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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(appset): avoid panic when no steps in rollingSync #20357
Conversation
❌ Preview Environment deleted from BunnyshellAvailable commands (reply to this comment):
|
7027c9f
to
e02882c
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #20357 +/- ##
=========================================
Coverage ? 55.08%
=========================================
Files ? 322
Lines ? 54932
Branches ? 0
=========================================
Hits ? 30260
Misses ? 22067
Partials ? 2605 ☔ View full report in Codecov by Sentry. |
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
@@ -1018,6 +1018,16 @@ func statusStrings(app argov1alpha1.Application) (string, string, string) { | |||
return healthStatusString, syncStatusString, operationPhaseString | |||
} | |||
|
|||
func getAppStep(appName string, appStepMap map[string]int) string { |
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.
I think for further reusability of this function, it would make more sense to return an int
instead of a string here.
e02882c
to
31e75b1
Compare
Signed-off-by: cef <moncef.abboud95@gmail.com>
31e75b1
to
2b40a79
Compare
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! Thanks a lot for fixing this.
/cherry-pick release-2.13 |
Signed-off-by: cef <moncef.abboud95@gmail.com>
Signed-off-by: cef <moncef.abboud95@gmail.com> Signed-off-by: Adrian Aneci <aneci@adobe.com>
Closes #18817.
Description
When using Applicationset's rolling sync, having no steps in the manifest results in a panic. This PR attempts to fix that by ensuring a positive number of steps.
Additionally, applications not selected by MatchExpressions are still treated as part of
Step 1
(actually Step 0 due to 1-based indexing) because theappStepMap
defaults to 0 and there is no validation for the presence in the map.These applications are not synced by the rolling sync. I suggest assigning them a value of
-1
to clearly indicate that they are excluded from the sync and must be manually synced.Checklist: