controller: work around milliseconds skew in AddAfter

This commit is contained in:
Michail Kargakis
2017-03-18 23:44:43 -04:00
parent 948e3754f8
commit 68b78282d7
4 changed files with 12 additions and 4 deletions

View File

@@ -346,7 +346,9 @@ func (dsc *DaemonSetsController) updatePod(old, cur interface{}) {
dsc.enqueueDaemonSet(ds)
// See https://github.com/kubernetes/kubernetes/pull/38076 for more details
if changedToReady && ds.Spec.MinReadySeconds > 0 {
dsc.enqueueDaemonSetAfter(ds, time.Duration(ds.Spec.MinReadySeconds)*time.Second)
// Add a second to avoid milliseconds skew in AddAfter.
// See https://github.com/kubernetes/kubernetes/issues/39785#issuecomment-279959133 for more info.
dsc.enqueueDaemonSetAfter(ds, (time.Duration(ds.Spec.MinReadySeconds)*time.Second)+time.Second)
}
return
}