13647: Don't do API calls while loading controller config.
[arvados.git] / lib / service / cmd.go
index c410e536847dde841d3f7f1ad553f07acb93cc55..d5619b87b307c53e781ea77b78ba943b20f78735 100644 (file)
@@ -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