mirror of
https://github.com/kemko/nomad.git
synced 2026-01-07 10:55:42 +03:00
scheduler: fix NPE when deployment is nil, but placement is a canary
This commit is contained in:
committed by
Preetha Appan
parent
14c5a1c1f1
commit
80a04052b6
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user