appease the linter and fix an incorrect test

This commit is contained in:
Chris Baker
2021-01-08 19:38:25 +00:00
parent 9087e0be99
commit 59271c668e
2 changed files with 3 additions and 3 deletions

View File

@@ -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

View File

@@ -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")
}
}