shorten logic around waiting for daemonsets to be online for 5s
@@ -628,16 +628,14 @@ func (dsc *Checker) waitForPodsToComeOnline(ctx context.Context) error {
log.Infoln(dsc.Name(), "Daemonset "+dsc.dsName()+" done deploying pods.")
return nil
}
- }
- // if the DS is unhealthy during one of our checks, set the counter back to 0
- if ds.Status.NumberAvailable != ds.Status.DesiredNumberScheduled && ds.Status.DesiredNumberScheduled > 0 && counter >= 1 {
+ } else {
if counter > 0 {
log.Infoln(dsc.Name(), "Daemonset "+dsc.dsName()+" was ready for", counter, "out of 5 seconds but has left the ready state. Restarting 5 second timer.")
- }
counter = 0
}
}
}
+}
// getNodesMissingDSPod gets a list of nodes that do not have a DS pod running on them
func (dsc *Checker) getNodesMissingDSPod() ([]string, error) {
