check Status.ObservedGeneration of DaemonSet

Signed-off-by: jackyu <jackyu@yunify.com>
pull/11102/head
jackyu 3 years ago
parent e7c1fa8955
commit 10137555a8

@ -286,6 +286,12 @@ func (c *ReadyChecker) daemonSetReady(ds *appsv1.DaemonSet) bool {
return true return true
} }
// the resource not generated by DaemonSet controller.
if ds.Status.ObservedGeneration == 0 {
c.log("DaemonSet is not ready: %s/%s, The most recent generation is 0.", ds.Namespace, ds.Name)
return false
}
// Make sure all the updated pods have been scheduled // Make sure all the updated pods have been scheduled
if ds.Status.UpdatedNumberScheduled != ds.Status.DesiredNumberScheduled { if ds.Status.UpdatedNumberScheduled != ds.Status.DesiredNumberScheduled {
c.log("DaemonSet is not ready: %s/%s. %d out of %d expected pods have been scheduled", ds.Namespace, ds.Name, ds.Status.UpdatedNumberScheduled, ds.Status.DesiredNumberScheduled) c.log("DaemonSet is not ready: %s/%s. %d out of %d expected pods have been scheduled", ds.Namespace, ds.Name, ds.Status.UpdatedNumberScheduled, ds.Status.DesiredNumberScheduled)

Loading…
Cancel
Save