From 28fd5d207bcc462ea4d49c9f5034d3127cc6e0d8 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 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/schema/v1/stateful_set.go b/pkg/schema/v1/stateful_set.go index b9879d64..d74292e7 100644 --- a/pkg/schema/v1/stateful_set.go +++ b/pkg/schema/v1/stateful_set.go @@ -114,6 +114,11 @@ func (s *StatefulSet) Obtain(k8s kmetav1.Object) { } func (s *StatefulSet) getIcingaState() (IcingaState, string) { + gracePeriodReason := IsWithinGracePeriod(s) + if gracePeriodReason != nil { + return Ok, *gracePeriodReason + } + switch { case s.AvailableReplicas == 0: reason := fmt.Sprintf("StatefulSet %s/%s has 0 available replicas", s.Namespace, s.Name)