Skip to content

Commit 71aef74

Browse files
Merge pull request #430 from wking/drop-available-deployment-check
lib/resourcebuilder/apps: Only error on Deployment Available=False *and* Progressing=False
2 parents a03a895 + 0442094 commit 71aef74

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

lib/resourcebuilder/apps.go

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -114,20 +114,11 @@ func (b *builder) checkDeploymentHealth(ctx context.Context, deployment *appsv1.
114114
}
115115
}
116116

117-
if availableCondition != nil && availableCondition.Status == corev1.ConditionFalse {
117+
if availableCondition != nil && availableCondition.Status == corev1.ConditionFalse && progressingCondition != nil && progressingCondition.Status == corev1.ConditionFalse {
118118
return &payload.UpdateError{
119-
Nested: fmt.Errorf("deployment %s is not available; updated replicas=%d of %d, available replicas=%d of %d", iden, d.Status.UpdatedReplicas, d.Status.Replicas, d.Status.AvailableReplicas, d.Status.Replicas),
119+
Nested: fmt.Errorf("deployment %s is not available and not progressing; updated replicas=%d of %d, available replicas=%d of %d", iden, d.Status.UpdatedReplicas, d.Status.Replicas, d.Status.AvailableReplicas, d.Status.Replicas),
120120
Reason: "WorkloadNotAvailable",
121-
Message: fmt.Sprintf("deployment %s is not available %s: %s", iden, availableCondition.Reason, availableCondition.Message),
122-
Name: iden,
123-
}
124-
}
125-
126-
if progressingCondition != nil && progressingCondition.Status == corev1.ConditionFalse {
127-
return &payload.UpdateError{
128-
Nested: fmt.Errorf("deployment %s is not progressing; updated replicas=%d of %d, available replicas=%d of %d", iden, d.Status.UpdatedReplicas, d.Status.Replicas, d.Status.AvailableReplicas, d.Status.Replicas),
129-
Reason: "WorkloadNotAvailable",
130-
Message: fmt.Sprintf("deployment %s is not progressing %s: %s", iden, progressingCondition.Reason, progressingCondition.Message),
121+
Message: fmt.Sprintf("deployment %s is not available %s (%s) or progressing %s (%s)", iden, availableCondition.Reason, availableCondition.Message, progressingCondition.Reason, progressingCondition.Message),
131122
Name: iden,
132123
}
133124
}

0 commit comments

Comments
 (0)