From 2be745ad23e4202a3ad12772a713b3a09497d7a0 Mon Sep 17 00:00:00 2001 From: David Glasser Date: Fri, 10 May 2024 11:29:38 -0700 Subject: [PATCH] health: for OnDelete statefulsets, include updated replica count in health 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. --- pkg/health/health_statefulset.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/health/health_statefulset.go b/pkg/health/health_statefulset.go index 52d156712..beab526f9 100644 --- a/pkg/health/health_statefulset.go +++ b/pkg/health/health_statefulset.go @@ -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 {