Merge branch 'f-7422-scaling-events' of github.com:hashicorp/nomad into f-7422-scaling-events
This commit is contained in:
commit
285728f3fa
|
@ -934,7 +934,7 @@ func (j *Job) Scale(args *structs.JobScaleRequest, reply *structs.JobRegisterRes
|
||||||
reply.JobModifyIndex = job.ModifyIndex
|
reply.JobModifyIndex = job.ModifyIndex
|
||||||
}
|
}
|
||||||
|
|
||||||
// only create an eval for non-dispatch jobs and if the count was provided
|
// Only create an eval for non-dispatch jobs and if the count was provided
|
||||||
// for now, we'll do this even if count didn't change
|
// for now, we'll do this even if count didn't change
|
||||||
if !job.IsPeriodic() && !job.IsParameterized() && args.Count != nil {
|
if !job.IsPeriodic() && !job.IsParameterized() && args.Count != nil {
|
||||||
eval := &structs.Evaluation{
|
eval := &structs.Evaluation{
|
||||||
|
|
|
@ -654,12 +654,12 @@ func (s *StateStore) UpsertScalingEvent(index uint64, req *structs.ScalingEventR
|
||||||
req.ScalingEvent.CreateIndex = index
|
req.ScalingEvent.CreateIndex = index
|
||||||
|
|
||||||
events := jobEvents.ScalingEvents[req.TaskGroup]
|
events := jobEvents.ScalingEvents[req.TaskGroup]
|
||||||
// prepend this latest event
|
// Prepend this latest event
|
||||||
events = append(
|
events = append(
|
||||||
[]*structs.ScalingEvent{req.ScalingEvent},
|
[]*structs.ScalingEvent{req.ScalingEvent},
|
||||||
events...,
|
events...,
|
||||||
)
|
)
|
||||||
// truncate older events
|
// Truncate older events
|
||||||
if len(events) > structs.JobTrackedScalingEvents {
|
if len(events) > structs.JobTrackedScalingEvents {
|
||||||
events = events[0:structs.JobTrackedScalingEvents]
|
events = events[0:structs.JobTrackedScalingEvents]
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue