Merge pull request #7961 from hashicorp/b-always-validate-default-scheduler-config

always check `default_scheduler_config` config
This commit is contained in:
Mahmood Ali 2020-05-14 14:35:06 -04:00 committed by GitHub
commit ba13fa333c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -349,11 +349,12 @@ func (c *Command) isValidConfig(config, cmdConfig *Config) bool {
}
}
if config.DevMode {
// Skip the rest of the validation for dev mode
return true
if err := config.Server.DefaultSchedulerConfig.Validate(); err != nil {
c.Ui.Error(err.Error())
return false
}
if !config.DevMode {
// Ensure that we have the directories we need to run.
if config.Server.Enabled && config.DataDir == "" {
c.Ui.Error("Must specify data directory")
@ -378,10 +379,6 @@ func (c *Command) isValidConfig(config, cmdConfig *Config) bool {
if config.Server.Enabled && config.Server.BootstrapExpect == 1 {
c.Ui.Error("WARNING: Bootstrap mode enabled! Potentially unsafe operation.")
}
if err := config.Server.DefaultSchedulerConfig.Validate(); err != nil {
c.Ui.Error(err.Error())
return false
}
return true