Merge pull request #99398 from tnqn/ds-update-retry

Fix DaemonSet status update retry
This commit is contained in:
Kubernetes Prow Robot
2021-05-18 22:32:50 -07:00
committed by GitHub
2 changed files with 82 additions and 1 deletions

View File

@@ -1068,7 +1068,7 @@ func storeDaemonSetStatus(dsClient unversionedapps.DaemonSetInterface, ds *apps.
toUpdate := ds.DeepCopy()
var updateErr, getErr error
for i := 0; i < StatusUpdateRetries; i++ {
for i := 0; ; i++ {
if updateObservedGen {
toUpdate.Status.ObservedGeneration = ds.Generation
}
@@ -1084,6 +1084,10 @@ func storeDaemonSetStatus(dsClient unversionedapps.DaemonSetInterface, ds *apps.
return nil
}
// Stop retrying if we exceed statusUpdateRetries - the DaemonSet will be requeued with a rate limit.
if i >= StatusUpdateRetries {
break
}
// Update the set with the latest resource version for the next poll
if toUpdate, getErr = dsClient.Get(context.TODO(), ds.Name, metav1.GetOptions{}); getErr != nil {
// If the GET fails we can't trust status.Replicas anymore. This error