Merge pull request #5265 from hashicorp/b_schedconfig_panicfix
Make sure that all servers are 0.9 to apply scheduler config
This commit is contained in:
commit
5d428f9ea6
|
@ -42,6 +42,8 @@ const (
|
|||
|
||||
var minAutopilotVersion = version.Must(version.NewVersion("0.8.0"))
|
||||
|
||||
var minSchedulerConfigVersion = version.Must(version.NewVersion("0.9.0"))
|
||||
|
||||
// Default configuration for scheduler with preemption enabled for system jobs
|
||||
var defaultSchedulerConfig = &structs.SchedulerConfiguration{
|
||||
PreemptionConfig: structs.PreemptionConfig{
|
||||
|
@ -1267,6 +1269,10 @@ func (s *Server) getOrCreateSchedulerConfig() *structs.SchedulerConfiguration {
|
|||
if config != nil {
|
||||
return config
|
||||
}
|
||||
if !ServersMeetMinimumVersion(s.Members(), minSchedulerConfigVersion) {
|
||||
s.logger.Named("core").Warn("can't initialize scheduler config until all servers are above minimum version", "min_version", minSchedulerConfigVersion)
|
||||
return nil
|
||||
}
|
||||
|
||||
req := structs.SchedulerSetConfigRequest{Config: *defaultSchedulerConfig}
|
||||
if _, _, err = s.raftApply(structs.SchedulerConfigRequestType, req); err != nil {
|
||||
|
|
Loading…
Reference in a new issue