From 5c4df9b5ccefb0e5ae87b80521c74a100b3ecf9f Mon Sep 17 00:00:00 2001 From: Jonada Hoxha Date: Mon, 27 May 2024 11:23:03 +0200 Subject: [PATCH] Add grace period check for ReplicaSet availability --- pkg/schema/v1/replica_set.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/schema/v1/replica_set.go b/pkg/schema/v1/replica_set.go index f4accfe8..15867ccd 100644 --- a/pkg/schema/v1/replica_set.go +++ b/pkg/schema/v1/replica_set.go @@ -130,6 +130,11 @@ func (r *ReplicaSet) getIcingaState() (IcingaState, string) { return Unknown, reason } + gracePeriodReason := IsWithinGracePeriod(r) + if gracePeriodReason != nil { + return Ok, *gracePeriodReason + } + for _, condition := range r.Conditions { if condition.Type == "ReplicaFailure" && condition.Status == "True" { reason := fmt.Sprintf("ReplicaSet %s/%s has a failure condition: %s", r.Namespace, r.Name, condition.Message)