Skip to content

Commit

Permalink
Add grace period check for ReplicaSet availability
Browse files Browse the repository at this point in the history
  • Loading branch information
jhoxhaa committed Jun 3, 2024
1 parent ebe79a9 commit 51b7b34
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/schema/v1/replica_set.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,10 @@ func (r *ReplicaSet) getIcingaState() (IcingaState, string) {
return Unknown, reason
}

if gracePeriodReason := IsWithinGracePeriod(r); gracePeriodReason != nil {
return Ok, *gracePeriodReason
}

for _, condition := range r.Conditions {
if condition.Type == string(kappsv1.ReplicaSetReplicaFailure) && condition.Status == string(kcorev1.ConditionTrue) {
reason := fmt.Sprintf("ReplicaSet %s/%s has a failure condition: %s", r.Namespace, r.Name, condition.Message)
Expand Down

0 comments on commit 51b7b34

Please sign in to comment.