From b0050df3235264cf17a3154c16a2ae8628602228 Mon Sep 17 00:00:00 2001 From: Jonada Hoxha Date: Fri, 13 Sep 2024 13:26:10 +0200 Subject: [PATCH] Return `Pending` for resources in `grace period` --- pkg/schema/v1/daemon_set.go | 2 +- pkg/schema/v1/deployment.go | 2 +- pkg/schema/v1/replica_set.go | 2 +- pkg/schema/v1/stateful_set.go | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/schema/v1/daemon_set.go b/pkg/schema/v1/daemon_set.go index 91c7744..f30bb95 100644 --- a/pkg/schema/v1/daemon_set.go +++ b/pkg/schema/v1/daemon_set.go @@ -162,7 +162,7 @@ func (d *DaemonSet) getIcingaState() (IcingaState, string) { } if gracePeriodReason := IsWithinGracePeriod(d); gracePeriodReason != nil { - return Ok, *gracePeriodReason + return Pending, *gracePeriodReason } switch { diff --git a/pkg/schema/v1/deployment.go b/pkg/schema/v1/deployment.go index 962b233..f1d7d0d 100644 --- a/pkg/schema/v1/deployment.go +++ b/pkg/schema/v1/deployment.go @@ -168,7 +168,7 @@ func (d *Deployment) Obtain(k8s kmetav1.Object) { func (d *Deployment) getIcingaState() (IcingaState, string) { if gracePeriodReason := IsWithinGracePeriod(d); gracePeriodReason != nil { - return Ok, *gracePeriodReason + return Pending, *gracePeriodReason } for _, condition := range d.Conditions { diff --git a/pkg/schema/v1/replica_set.go b/pkg/schema/v1/replica_set.go index f658ebf..4d522cf 100644 --- a/pkg/schema/v1/replica_set.go +++ b/pkg/schema/v1/replica_set.go @@ -155,7 +155,7 @@ func (r *ReplicaSet) Obtain(k8s kmetav1.Object) { func (r *ReplicaSet) getIcingaState() (IcingaState, string) { if gracePeriodReason := IsWithinGracePeriod(r); gracePeriodReason != nil { - return Ok, *gracePeriodReason + return Pending, *gracePeriodReason } for _, condition := range r.Conditions { diff --git a/pkg/schema/v1/stateful_set.go b/pkg/schema/v1/stateful_set.go index 3583599..078de54 100644 --- a/pkg/schema/v1/stateful_set.go +++ b/pkg/schema/v1/stateful_set.go @@ -180,7 +180,7 @@ func (s *StatefulSet) Obtain(k8s kmetav1.Object) { func (s *StatefulSet) getIcingaState() (IcingaState, string) { if gracePeriodReason := IsWithinGracePeriod(s); gracePeriodReason != nil { - return Ok, *gracePeriodReason + return Pending, *gracePeriodReason } switch {