Skip to content

Commit

Permalink
Merge pull request #5259 from hashicorp/b-npe-scheduler
Browse files Browse the repository at this point in the history
scheduler: fix NPE when deployment is nil, but placement is a canary
  • Loading branch information
preetapan committed Jan 29, 2019
2 parents 14c5a1c + 80a0405 commit 4c11386
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scheduler/generic_sched.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 4c11386

Please sign in to comment.