From 7f5a5b5e9d4f2405edbeacf29c3220f48aa32530 Mon Sep 17 00:00:00 2001 From: Anis Elleuch Date: Thu, 23 Mar 2017 00:11:58 +0100 Subject: [PATCH] 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. --- cmd/config-v15.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/cmd/config-v15.go b/cmd/config-v15.go index dba4e38a1..fd9c09032 100644 --- a/cmd/config-v15.go +++ b/cmd/config-v15.go @@ -235,9 +235,12 @@ func validateConfig() error { return fmt.Errorf("Browser config value %s is invalid", b) } - // Validate credential field - if !srvCfg.Credential.IsValid() { - return errors.New("invalid credential") + // Validate credential fields only when + // they are not set via the environment + if !globalIsEnvCreds { + if !srvCfg.Credential.IsValid() { + return errors.New("invalid credential") + } } // Validate logger field