-
Notifications
You must be signed in to change notification settings - Fork 270
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: health status is set to healthy for statefulset with updateStrat… #136
Conversation
Codecov Report
@@ Coverage Diff @@
## master #136 +/- ##
==========================================
- Coverage 55.80% 55.73% -0.07%
==========================================
Files 25 25
Lines 2724 2729 +5
==========================================
+ Hits 1520 1521 +1
- Misses 1065 1070 +5
+ Partials 139 138 -1
Continue to review full report at Codecov.
|
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.
Please add unit test for stateful set with OnDelete strategy.
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
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. Thank you!
if sts.Spec.UpdateStrategy.Type == appsv1.OnDeleteStatefulSetStrategyType { | ||
return &HealthStatus{ | ||
Status: HealthStatusHealthy, | ||
Message: fmt.Sprintf("statefulset has %d ready pods", sts.Status.ReadyReplicas), |
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 understand the issue that this change was fixing and it makes sense to me that this counts as "healthy", but what do folks think about iterating on this so that the message lets you know whether or not UpdatedReplicas matches Replicas in the OnDelete case?
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.
…ealth message Since argoproj#136 we've had the policy that an OnDelete statefulset is healthy as long as the statefulset spec is updated and the right number of pods are running, even if some of the pods are old and haven't been deleted yet. That's reasonable, but it still can be helpful to be able to see directly in the health message (and eg, in the ArgoCD UI) how many replicas have been updated. This adds that to the message.
…ealth message Since argoproj#136 we've had the policy that an OnDelete statefulset is healthy as long as the statefulset spec is updated and the right number of pods are running, even if some of the pods are old and haven't been deleted yet. That's reasonable, but it still can be helpful to be able to see directly in the health message (and eg, in the ArgoCD UI) how many replicas have been updated. This adds that to the message. Signed-off-by: David Glasser <[email protected]>
fixes argoproj/argo-cd#1881