From 981db4984c9acaac2ebb611b215e755dbbd0078e Mon Sep 17 00:00:00 2001 From: Jonada Hoxha Date: Mon, 27 May 2024 14:41:38 +0200 Subject: [PATCH] Add grace period check for StatefulSet availability --- pkg/schema/v1/stateful_set.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/schema/v1/stateful_set.go b/pkg/schema/v1/stateful_set.go index d18cde40..54a5aead 100644 --- a/pkg/schema/v1/stateful_set.go +++ b/pkg/schema/v1/stateful_set.go @@ -122,6 +122,10 @@ func (s *StatefulSet) Obtain(k8s kmetav1.Object) { } func (s *StatefulSet) getIcingaState() (IcingaState, string) { + if gracePeriodReason := IsWithinGracePeriod(s); gracePeriodReason != nil { + return Ok, *gracePeriodReason + } + switch { case s.AvailableReplicas == 0: reason := fmt.Sprintf("StatefulSet %s/%s has no replica available from %d desired", s.Namespace, s.Name, s.DesiredReplicas)