Merge pull request #5259 from hashicorp/b-npe-scheduler
scheduler: fix NPE when deployment is nil, but placement is a canary
This commit is contained in:
commit
cf15a80aad
|
@ -517,7 +517,7 @@ func (s *GenericScheduler) computePlacements(destructive, place []placementResul
|
|||
|
||||
// If we are placing a canary and we found a match, add the canary
|
||||
// to the deployment state object and mark it as a canary.
|
||||
if missing.Canary() {
|
||||
if missing.Canary() && s.deployment != nil {
|
||||
if state, ok := s.deployment.TaskGroups[tg.Name]; ok {
|
||||
state.PlacedCanaries = append(state.PlacedCanaries, alloc.ID)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue