Merge pull request #8017 from hashicorp/f-change-sched-updated

Set Updated to true for all non-CAS requests on v1/operator/scheduler/configuration
This commit is contained in:
Mahmood Ali 2020-06-26 08:39:37 -04:00 committed by GitHub
commit 49a177ce28
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -315,7 +315,7 @@ func (op *Operator) SchedulerSetConfiguration(args *structs.SchedulerSetConfigRe
return structs.ErrPermissionDenied
}
// All servers should be at or above 0.9.0 to apply this operatation
// All servers should be at or above 0.9.0 to apply this operation
if !ServersMeetMinimumVersion(op.srv.Members(), minSchedulerConfigVersion, false) {
return fmt.Errorf("All servers should be running version %v to update scheduler config", minSchedulerConfigVersion)
}
@ -327,9 +327,9 @@ func (op *Operator) SchedulerSetConfiguration(args *structs.SchedulerSetConfigRe
} else if respErr, ok := resp.(error); ok {
return respErr
}
// Check if the return type is a bool
// Only applies to CAS requests
// If CAS request, raft returns a boolean indicating if the update was applied.
// Otherwise, assume success
reply.Updated = true
if respBool, ok := resp.(bool); ok {
reply.Updated = respBool
}