[ARVADOS] updated: 1.3.0-1287-g3a81f54c8

Git user git at public.curoverse.com
Thu Jul 11 17:32:51 UTC 2019


Summary of changes:
 lib/config/load.go       | 2 +-
 sdk/go/arvados/config.go | 9 ++++++++-
 2 files changed, 9 insertions(+), 2 deletions(-)

       via  3a81f54c8c0da6babdfb9014a64079b6b41f73c7 (commit)
      from  aa6dd2b23c738ebe01cdbaed86ef24ce343b29ae (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 3a81f54c8c0da6babdfb9014a64079b6b41f73c7
Author: Tom Clegg <tclegg at veritasgenetics.com>
Date:   Thu Jul 11 13:32:23 2019 -0400

    13647: ARVADOS_CONFIG env var overrides default cluster config path.
    
    Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tclegg at veritasgenetics.com>

diff --git a/lib/config/load.go b/lib/config/load.go
index b3709b5bd..a11878bcc 100644
--- a/lib/config/load.go
+++ b/lib/config/load.go
@@ -51,7 +51,7 @@ func NewLoader(stdin io.Reader, logger logrus.FieldLogger) *Loader {
 //	flagset.Parse([]string{"-config", "/tmp/c.yaml"})
 //	// ldr.Path == "/tmp/c.yaml"
 func (ldr *Loader) SetupFlags(flagset *flag.FlagSet) {
-	flagset.StringVar(&ldr.Path, "config", arvados.DefaultConfigFile, "Site configuration `file`")
+	flagset.StringVar(&ldr.Path, "config", arvados.DefaultConfigFile, "Site configuration `file` (default may be overridden by setting an ARVADOS_CONFIG environment variable)")
 	flagset.StringVar(&ldr.KeepstorePath, "legacy-keepstore-config", defaultKeepstoreConfigPath, "Legacy keepstore configuration `file`")
 }
 
diff --git a/sdk/go/arvados/config.go b/sdk/go/arvados/config.go
index 9c667610b..aa0e83c66 100644
--- a/sdk/go/arvados/config.go
+++ b/sdk/go/arvados/config.go
@@ -9,11 +9,18 @@ import (
 	"errors"
 	"fmt"
 	"net/url"
+	"os"
 
 	"git.curoverse.com/arvados.git/sdk/go/config"
 )
 
-const DefaultConfigFile = "/etc/arvados/config.yml"
+var DefaultConfigFile = func() string {
+	if path := os.Getenv("ARVADOS_CONFIG"); path != "" {
+		return path
+	} else {
+		return "/etc/arvados/config.yml"
+	}
+}()
 
 type Config struct {
 	Clusters map[string]Cluster

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list