Skip to content

Commit e70a259

Browse files
Merge pull request #343 from smarterclayton/do_not_log
Do not report errors to status loop on progressing
2 parents 89cb270 + 2f3fab8 commit e70a259

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

lib/resourcebuilder/apps.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -142,16 +142,21 @@ func waitForDeploymentCompletion(ctx context.Context, client appsclientv1.Deploy
142142
return false, nil
143143
}
144144

145-
if progressingCondition != nil && progressingCondition.Status == corev1.ConditionTrue {
145+
if progressingCondition != nil && progressingCondition.Status == corev1.ConditionFalse && progressingCondition.Reason == "ProgressDeadlineExceeded" {
146146
lastErr = &payload.UpdateError{
147-
Nested: fmt.Errorf("deployment %s is progressing; updated replicas=%d of %d, available replicas=%d of %d", iden, d.Status.UpdatedReplicas, d.Status.Replicas, d.Status.AvailableReplicas, d.Status.Replicas),
147+
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),
148148
Reason: "WorkloadNotAvailable",
149-
Message: fmt.Sprintf("deployment %s is progressing %s: %s", iden, progressingCondition.Reason, progressingCondition.Message),
149+
Message: fmt.Sprintf("deployment %s is not progressing %s: %s", iden, progressingCondition.Reason, progressingCondition.Message),
150150
Name: iden,
151151
}
152152
return false, nil
153153
}
154154

155+
if progressingCondition != nil && progressingCondition.Status == corev1.ConditionTrue {
156+
klog.V(4).Infof("deployment %s is progressing", iden)
157+
return false, nil
158+
}
159+
155160
klog.Errorf("deployment %s is in unknown state", iden)
156161
return false, nil
157162
}, ctx.Done())
@@ -251,12 +256,7 @@ func waitForDaemonsetRollout(ctx context.Context, client appsclientv1.DaemonSets
251256
if d.Generation <= d.Status.ObservedGeneration && d.Status.UpdatedNumberScheduled == d.Status.DesiredNumberScheduled && d.Status.NumberUnavailable == 0 {
252257
return true, nil
253258
}
254-
lastErr = &payload.UpdateError{
255-
Nested: fmt.Errorf("daemonset %s is progressing; updated replicas=%d of %d, available replicas=%d of %d", iden, d.Status.UpdatedNumberScheduled, d.Status.DesiredNumberScheduled, d.Status.NumberAvailable, d.Status.DesiredNumberScheduled),
256-
Reason: "WorkloadNotAvailable",
257-
Message: fmt.Sprintf("daemonset %s is progressing", iden),
258-
Name: iden,
259-
}
259+
klog.V(4).Infof("daemonset %s is progressing", iden)
260260
return false, nil
261261
}, ctx.Done())
262262
if err != nil {

0 commit comments

Comments
 (0)