appease the linter and fix an incorrect test
This commit is contained in:
parent
a53e54d7a6
commit
d43e0d10c0
|
@ -53,7 +53,7 @@ func testJobWithScalingPolicy() *Job {
|
|||
job.TaskGroups[0].Scaling = &ScalingPolicy{
|
||||
Policy: map[string]interface{}{},
|
||||
Min: int64ToPtr(1),
|
||||
Max: int64ToPtr(1),
|
||||
Max: int64ToPtr(5),
|
||||
Enabled: boolToPtr(true),
|
||||
}
|
||||
return job
|
||||
|
|
|
@ -1043,11 +1043,11 @@ func (j *Job) Scale(args *structs.JobScaleRequest, reply *structs.JobRegisterRes
|
|||
if found.Scaling != nil {
|
||||
if *args.Count < found.Scaling.Min {
|
||||
return structs.NewErrRPCCoded(400,
|
||||
fmt.Sprintf("new scaling count cannot be less than the scaling policy minimum"))
|
||||
"new scaling count cannot be less than the scaling policy minimum")
|
||||
}
|
||||
if found.Scaling.Max < *args.Count {
|
||||
return structs.NewErrRPCCoded(400,
|
||||
fmt.Sprintf("new scaling count cannot be greater than the scaling policy maximum"))
|
||||
"new scaling count cannot be greater than the scaling policy maximum")
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue