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 3, 2024
1 parent 81872d6 commit 3bc2b64
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/schema/v1/stateful_set.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,10 @@ func (s *StatefulSet) Obtain(k8s kmetav1.Object) {
}

func (s *StatefulSet) getIcingaState() (IcingaState, string) {
if gracePeriodReason := IsWithinGracePeriod(s); gracePeriodReason != nil {
return Ok, *gracePeriodReason
}

switch {
case s.AvailableReplicas == 0:
reason := fmt.Sprintf("StatefulSet %s/%s has no replica available from %d desired", s.Namespace, s.Name, s.DesiredReplicas)
Expand Down

0 comments on commit 3bc2b64

Please sign in to comment.