Skip to content

Commit

Permalink
Merge pull request kubernetes#15944 from mqliang/assignoutloop
Browse files Browse the repository at this point in the history
Move assignment statement out of loop
  • Loading branch information
j3ffml committed Oct 21, 2015
2 parents d4de35e + 1638607 commit 236193a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pkg/controller/daemon/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -406,11 +406,12 @@ func storeDaemonSetStatus(dsClient client.DaemonSetInterface, ds *extensions.Dae
return nil
}

ds.Status.DesiredNumberScheduled = desiredNumberScheduled
ds.Status.CurrentNumberScheduled = currentNumberScheduled
ds.Status.NumberMisscheduled = numberMisscheduled

var updateErr, getErr error
for i := 0; i <= StatusUpdateRetries; i++ {
ds.Status.DesiredNumberScheduled = desiredNumberScheduled
ds.Status.CurrentNumberScheduled = currentNumberScheduled
ds.Status.NumberMisscheduled = numberMisscheduled
_, updateErr = dsClient.UpdateStatus(ds)
if updateErr == nil {
// successful update
Expand Down

0 comments on commit 236193a

Please sign in to comment.