Remove comments that no longer apply
This commit is contained in:
parent
6ed93d4b82
commit
db575aad13
@ -149,12 +149,12 @@ func readConfigurationFile(fileName string) (config *Config, err error) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// parseAndValidateConfigBytes parses a Gatus configuration file into a Config struct and validates its parameters
|
||||||
func parseAndValidateConfigBytes(yamlBytes []byte) (config *Config, err error) {
|
func parseAndValidateConfigBytes(yamlBytes []byte) (config *Config, err error) {
|
||||||
// Expand environment variables
|
// Expand environment variables
|
||||||
yamlBytes = []byte(os.ExpandEnv(string(yamlBytes)))
|
yamlBytes = []byte(os.ExpandEnv(string(yamlBytes)))
|
||||||
// Parse configuration file
|
// Parse configuration file
|
||||||
err = yaml.Unmarshal(yamlBytes, &config)
|
if err = yaml.Unmarshal(yamlBytes, &config); err != nil {
|
||||||
if err != nil {
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if config != nil && len(config.Services) > 0 { // XXX: Remove this in v5.0.0
|
if config != nil && len(config.Services) > 0 { // XXX: Remove this in v5.0.0
|
||||||
@ -167,8 +167,6 @@ func parseAndValidateConfigBytes(yamlBytes []byte) (config *Config, err error) {
|
|||||||
if config == nil || config.Endpoints == nil || len(config.Endpoints) == 0 {
|
if config == nil || config.Endpoints == nil || len(config.Endpoints) == 0 {
|
||||||
err = ErrNoEndpointInConfig
|
err = ErrNoEndpointInConfig
|
||||||
} else {
|
} else {
|
||||||
// Note that the functions below may panic, and this is on purpose to prevent Gatus from starting with
|
|
||||||
// invalid configurations
|
|
||||||
validateAlertingConfig(config.Alerting, config.Endpoints, config.Debug)
|
validateAlertingConfig(config.Alerting, config.Endpoints, config.Debug)
|
||||||
if err := validateSecurityConfig(config); err != nil {
|
if err := validateSecurityConfig(config); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
Loading…
x
Reference in New Issue
Block a user