Skip to content

Commit

Permalink
Add grace period check for StatefulSet availability
Browse files Browse the repository at this point in the history
  • Loading branch information
jhoxhaa committed Jun 2, 2024
1 parent baae465 commit 28fd5d2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/schema/v1/stateful_set.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 28fd5d2

Please sign in to comment.