mirror of
https://github.com/kemko/nomad.git
synced 2026-01-07 10:55:42 +03:00
Populating service ids only if allocations can be placed for system jobs
This commit is contained in:
@@ -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())
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user