Skip to content

Commit a4a3df6

Browse files
committed
health: for OnDelete statefulsets, include updated replica count in health 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]>
1 parent 0aecd43 commit a4a3df6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/health/health_statefulset.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ func getAppsv1StatefulSetHealth(sts *appsv1.StatefulSet) (*HealthStatus, error)
5656
if sts.Spec.UpdateStrategy.Type == appsv1.OnDeleteStatefulSetStrategyType {
5757
return &HealthStatus{
5858
Status: HealthStatusHealthy,
59-
Message: fmt.Sprintf("statefulset has %d ready pods", sts.Status.ReadyReplicas),
59+
Message: fmt.Sprintf("statefulset has %d ready pods (%d updated)", sts.Status.ReadyReplicas, sts.Status.UpdatedReplicas),
6060
}, nil
6161
}
6262
if sts.Status.UpdateRevision != sts.Status.CurrentRevision {

0 commit comments

Comments
 (0)