Skip to content

Commit

Permalink
Add grace period check for Deployment availability
Browse files Browse the repository at this point in the history
  • Loading branch information
jhoxhaa committed Jun 3, 2024
1 parent 0b62b0d commit 1badcec
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/schema/v1/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,10 @@ func (d *Deployment) Obtain(k8s kmetav1.Object) {
}

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

for _, condition := range d.Conditions {
if condition.Type == string(kappsv1.DeploymentAvailable) && condition.Status != string(kcorev1.ConditionTrue) {
reason := fmt.Sprintf("Deployment %s/%s is not available: %s", d.Namespace, d.Name, condition.Message)
Expand Down

0 comments on commit 1badcec

Please sign in to comment.