Skip to content

Commit

Permalink
simplify canary check
Browse files Browse the repository at this point in the history
`(alloc.DeploymentStatus == nil || !alloc.DeploymentStatus.IsCanary())`
and `!alloc.DeploymentStatus.IsCanary()` are equivalent.
  • Loading branch information
Mahmood Ali committed Aug 25, 2020
1 parent 3fef220 commit 7275650
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scheduler/reconcile.go
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,7 @@ func (a *allocReconciler) computePlacements(group *structs.TaskGroup,
reschedule: true,
canary: alloc.DeploymentStatus.IsCanary(),

downgradeNonCanary: canaryState && (alloc.DeploymentStatus == nil || !alloc.DeploymentStatus.IsCanary()),
downgradeNonCanary: canaryState && !alloc.DeploymentStatus.IsCanary(),
minJobVersion: alloc.Job.Version,
})
}
Expand Down

0 comments on commit 7275650

Please sign in to comment.