Retry once and requeue on failure to update status.Replicas

This commit is contained in:
Prashanth Balasubramanian
2015-05-01 08:49:06 -07:00
parent ee473edd45
commit 864e12d995
5 changed files with 133 additions and 29 deletions

View File

@@ -349,9 +349,12 @@ func (rm *ReplicationManager) syncReplicationController(key string) error {
rm.manageReplicas(filteredPods, &controller)
}
// Always updates status as pods come up or die
if err := updateReplicaCount(rm.kubeClient.ReplicationControllers(controller.Namespace), &controller, len(filteredPods)); err != nil {
glog.V(2).Infof("Failed to update replica count for controller %v, will try on next sync", controller.Name)
// Always updates status as pods come up or die.
if err := updateReplicaCount(rm.kubeClient.ReplicationControllers(controller.Namespace), controller, len(filteredPods)); err != nil {
// Multiple things could lead to this update failing. Requeuing the controller ensures
// we retry with some fairness.
glog.V(2).Infof("Failed to update replica count for controller %v, requeuing", controller.Name)
rm.enqueueController(&controller)
}
return nil
}