diff --git a/nomad/structs/structs.go b/nomad/structs/structs.go index b8f3ddaae..722319901 100644 --- a/nomad/structs/structs.go +++ b/nomad/structs/structs.go @@ -1508,7 +1508,7 @@ func (a *Allocation) PopulateServiceIDs() { for _, task := range tg.Tasks { for _, service := range task.Services { // We add a prefix to the Service ID so that we can know that this service - // is managed by Nomad Consul since Consul can also have service which are not + // is managed by Nomad since Consul can also have service which are not // managed by Nomad a.Services[service.Name] = fmt.Sprintf("%s-%s", NomadConsulPrefix, GenerateUUID()) } diff --git a/scheduler/system_sched.go b/scheduler/system_sched.go index 42370b8fd..80a87fe94 100644 --- a/scheduler/system_sched.go +++ b/scheduler/system_sched.go @@ -246,12 +246,12 @@ func (s *SystemScheduler) computePlacements(place []allocTuple) error { Metrics: s.ctx.Metrics(), } - // Generate the service ids for the tasks that this allocation is going - // to run - alloc.PopulateServiceIDs() - // Set fields based on if we found an allocation option if option != nil { + // Generate the service ids for the tasks that this allocation is going + // to run + alloc.PopulateServiceIDs() + alloc.NodeID = option.Node.ID alloc.TaskResources = option.TaskResources alloc.DesiredStatus = structs.AllocDesiredStatusRun