Skip to content

Commit

Permalink
health: for OnDelete statefulsets, include updated replica count in h…
Browse files Browse the repository at this point in the history
…ealth message

Since #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]>
  • Loading branch information
glasser committed May 10, 2024
1 parent 0aecd43 commit a4a3df6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/health/health_statefulset.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func getAppsv1StatefulSetHealth(sts *appsv1.StatefulSet) (*HealthStatus, error)
if sts.Spec.UpdateStrategy.Type == appsv1.OnDeleteStatefulSetStrategyType {
return &HealthStatus{
Status: HealthStatusHealthy,
Message: fmt.Sprintf("statefulset has %d ready pods", sts.Status.ReadyReplicas),
Message: fmt.Sprintf("statefulset has %d ready pods (%d updated)", sts.Status.ReadyReplicas, sts.Status.UpdatedReplicas),
}, nil
}
if sts.Status.UpdateRevision != sts.Status.CurrentRevision {
Expand Down

0 comments on commit a4a3df6

Please sign in to comment.