From 3bc2b64ff3633492eed7c5cf92896c4b42bf4f34 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 dcfa630e..da2a3fe7 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)