Skip to content

Commit 4bd520b

Browse files
committed
scheduler: DesiredCanaries can be set on every pass safely
The reconcile loop sets `DeploymentState.DesiredCanaries` only on the first pass through the loop. In MRD, deployments will make one pass though the loop while "pending", and were not ever getting `DesiredCanaries` set. This value is static for a given version of a job because it's coming from the update stanza, so it's entirely safe to re-assign the value on subsequent passes.
1 parent 1463df7 commit 4bd520b

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

scheduler/reconcile.go

+1-3
Original file line numberDiff line numberDiff line change
@@ -431,9 +431,7 @@ func (a *allocReconciler) computeGroup(group string, all allocSet) bool {
431431
if requireCanary && !a.deploymentPaused && !a.deploymentFailed {
432432
number := strategy.Canary - len(canaries)
433433
desiredChanges.Canary += uint64(number)
434-
if !existingDeployment {
435-
dstate.DesiredCanaries = strategy.Canary
436-
}
434+
dstate.DesiredCanaries = strategy.Canary
437435

438436
for _, name := range nameIndex.NextCanaries(uint(number), canaries, destructive) {
439437
a.result.place = append(a.result.place, allocPlaceResult{

0 commit comments

Comments
 (0)