config: Do not validate creds when set via env (#3955)

It is useless to validate access/secret keys stored in
config file when the user sets them in the environment.
master
Anis Elleuch 8 years ago committed by Harshavardhana
parent d4ca2ee1a3
commit 7f5a5b5e9d
  1. 9
      cmd/config-v15.go

@ -235,9 +235,12 @@ func validateConfig() error {
return fmt.Errorf("Browser config value %s is invalid", b) return fmt.Errorf("Browser config value %s is invalid", b)
} }
// Validate credential field // Validate credential fields only when
if !srvCfg.Credential.IsValid() { // they are not set via the environment
return errors.New("invalid credential") if !globalIsEnvCreds {
if !srvCfg.Credential.IsValid() {
return errors.New("invalid credential")
}
} }
// Validate logger field // Validate logger field

Loading…
Cancel
Save