You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
klog.Errorf("Error getting daemonset/%s in %q: %v", name, namespace, err)
71
-
// Ignore errors, give chance until timeout
82
+
83
+
klog.Errorf("Unexpected error while getting daemonset %q in %q (ignoring): %v", name, namespace, err)
72
84
returnfalse, nil
73
85
}
74
86
klog.V(3).Infof("Status of daemonset/%s in %s: %+v", name, namespace, ds.Status)
75
87
76
88
// Borrowed and adjusted from k8s.io/kubectl/pkg/polymorphichelpers/rollout_status.go
77
89
ifds.Generation>ds.Status.ObservedGeneration {
90
+
lastHumanReadableErr=fmt.Errorf("daemonset is still being processed by the controller (generation %d > observed %d)", ds.Generation, ds.Status.ObservedGeneration)
lastHumanReadableErr=fmt.Errorf("only %d of %d nodes have the updated daemonset pods", ds.Status.UpdatedNumberScheduled, ds.Status.DesiredNumberScheduled)
lastHumanReadableErr=fmt.Errorf("only %d of %d daemonset pods are ready across all nodes", ds.Status.NumberAvailable, ds.Status.DesiredNumberScheduled)
84
99
returnfalse, nil
85
100
}
86
101
returntrue, nil
87
102
})
88
103
iferr!=nil {
104
+
iferrors.Is(err, context.DeadlineExceeded) {
105
+
klog.Errorf("DaemonSet %q in %q namespace didn't become ready in %v: %v", name, namespace, timeout, lastHumanReadableErr)
106
+
returnfmt.Errorf("daemonset '%s' in namespace '%s' failed to become ready within %v. Last status: %v", name, namespace, timeout, lastHumanReadableErr)
107
+
}
89
108
klog.Errorf("Failed waiting for daemonset/%s in %s: %v", name, namespace, err)
90
109
returnerr
91
110
}
@@ -95,22 +114,31 @@ func waitForDaemonSet(ctx context.Context, client *appsclientv1.AppsV1Client, ti
lastHumanReadableErr=fmt.Errorf("deployment is still being processed by the controller (generation %d > observed %d)", deployment.Generation, deployment.Status.ObservedGeneration)
114
142
returnfalse, nil
115
143
}
116
144
// 'rollout status' command would check the 'Progressing' condition and if the reason is 'ProgressDeadlineExceeded',
@@ -120,17 +148,24 @@ func waitForDeployment(ctx context.Context, client *appsclientv1.AppsV1Client, t
120
148
// - we want to give full timeout duration for the Deployment to become ready, no early exits.
lastHumanReadableErr=fmt.Errorf("only %d of %d pods have been updated with the latest configuration", deployment.Status.UpdatedReplicas, *deployment.Spec.Replicas)
lastHumanReadableErr=fmt.Errorf("%d pods are still running the old configuration while %d are updated", deployment.Status.Replicas-deployment.Status.UpdatedReplicas, deployment.Status.UpdatedReplicas)
lastHumanReadableErr=fmt.Errorf("only %d of %d updated pods are ready", deployment.Status.AvailableReplicas, deployment.Status.UpdatedReplicas)
129
160
returnfalse, nil
130
161
}
131
162
returntrue, nil
132
163
})
133
164
iferr!=nil {
165
+
iferrors.Is(err, context.DeadlineExceeded) {
166
+
klog.Errorf("Deployment/%s in %s didn't become ready in %v: %v", name, namespace, timeout, lastHumanReadableErr)
167
+
returnfmt.Errorf("deployment '%s' in namespace '%s' failed to become ready within %v. Last status: %v", name, namespace, timeout, lastHumanReadableErr)
168
+
}
134
169
klog.Errorf("Failed waiting for deployment/%s in %s: %v", name, namespace, err)
135
170
returnerr
136
171
}
@@ -140,44 +175,87 @@ func waitForDeployment(ctx context.Context, client *appsclientv1.AppsV1Client, t
lastHumanReadableErr=fmt.Errorf("statefulset is still being processed by the controller (generation %d > observed %d)", sts.Generation, sts.Status.ObservedGeneration)
lastHumanReadableErr=fmt.Errorf("only %d of %d replicas have been updated (partition: %d)", sts.Status.UpdatedReplicas, *sts.Spec.Replicas, *sts.Spec.UpdateStrategy.RollingUpdate.Partition)
lastHumanReadableErr=fmt.Errorf("update revision (%s) differs from current revision (%s)", sts.Status.UpdateRevision, sts.Status.CurrentRevision)
173
220
returnfalse, nil
174
221
}
175
222
returntrue, nil
176
223
})
177
224
iferr!=nil {
225
+
iferrors.Is(err, context.DeadlineExceeded) {
226
+
klog.Errorf("Statefulset/%s in %s didn't become ready in %v: %v", name, namespace, timeout, lastHumanReadableErr)
227
+
returnfmt.Errorf("statefulset '%s' in namespace '%s' failed to become ready within %v. Last status: %v", name, namespace, timeout, lastHumanReadableErr)
228
+
}
178
229
klog.Errorf("Failed waiting for statefulset/%s in %s: %v", name, namespace, err)
179
230
returnerr
180
231
}
181
232
klog.Infof("StatefulSet/%s in %s is ready", name, namespace)
0 commit comments