[ARVADOS] updated: 1.3.0-1642-g1b6b38c5d

Git user git at public.curoverse.com
Thu Sep 19 17:46:39 UTC 2019


Summary of changes:
 lib/config/deprecated_keepstore.go | 4 ++++
 lib/config/load.go                 | 1 +
 lib/service/cmd.go                 | 8 ++++++++
 3 files changed, 13 insertions(+)

       via  1b6b38c5d2e181f357cab883b63917cb5eaa778c (commit)
      from  3056c56352955911bc8e844bc1e655cec5abe242 (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 1b6b38c5d2e181f357cab883b63917cb5eaa778c
Author: Tom Clegg <tclegg at veritasgenetics.com>
Date:   Thu Sep 19 13:45:49 2019 -0400

    13647: Don't do API calls while loading controller config.
    
    Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tclegg at veritasgenetics.com>

diff --git a/lib/config/deprecated_keepstore.go b/lib/config/deprecated_keepstore.go
index 1969c4c3c..04e937cc5 100644
--- a/lib/config/deprecated_keepstore.go
+++ b/lib/config/deprecated_keepstore.go
@@ -585,6 +585,10 @@ func (ldr *Loader) checkPendingKeepstoreMigrations(cluster arvados.Cluster) erro
 		ldr.Logger.Debug("Services.Controller.ExternalURL not configured -- skipping check for pending keepstore config migrations")
 		return nil
 	}
+	if ldr.SkipAPICalls {
+		ldr.Logger.Debug("(Loader).SkipAPICalls == true -- skipping check for pending keepstore config migrations")
+		return nil
+	}
 	client, err := arvados.NewClientFromConfig(&cluster)
 	if err != nil {
 		return err
diff --git a/lib/config/load.go b/lib/config/load.go
index db4bc9f59..93c36f69e 100644
--- a/lib/config/load.go
+++ b/lib/config/load.go
@@ -28,6 +28,7 @@ type Loader struct {
 	Logger         logrus.FieldLogger
 	SkipDeprecated bool // Don't load deprecated config keys
 	SkipLegacy     bool // Don't load legacy config files
+	SkipAPICalls   bool // Don't do checks that call RailsAPI/controller
 
 	Path                    string
 	KeepstorePath           string
diff --git a/lib/service/cmd.go b/lib/service/cmd.go
index c410e5368..d5619b87b 100644
--- a/lib/service/cmd.go
+++ b/lib/service/cmd.go
@@ -79,6 +79,14 @@ func (c *command) RunCommand(prog string, args []string, stdin io.Reader, stdout
 		return cmd.Version.RunCommand(prog, args, stdin, stdout, stderr)
 	}
 
+	if strings.HasSuffix(prog, "controller") {
+		// Some config-loader checks try to make API calls via
+		// controller. Those can't be expected to work if this
+		// process _is_ the controller: we haven't started an
+		// http server yet.
+		loader.SkipAPICalls = true
+	}
+
 	cfg, err := loader.Load()
 	if err != nil {
 		return 1

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list