17344: Give up early if cluster config cannot be fetched.
[arvados.git] / lib / diagnostics / cmd.go
index ed8d440b8944d20123041f86803707a2e216473d..3455d3307e71bff663aa44ea3023bf7b71efca26 100644 (file)
@@ -134,6 +134,7 @@ func (diag *diagnoser) runtests() {
 
        var cluster arvados.Cluster
        cfgpath := "arvados/v1/config"
+       cfgOK := false
        diag.dotest(20, fmt.Sprintf("getting exported config from https://%s/%s", client.APIHost, cfgpath), func() error {
                ctx, cancel := context.WithDeadline(context.Background(), time.Now().Add(diag.timeout))
                defer cancel()
@@ -142,6 +143,7 @@ func (diag *diagnoser) runtests() {
                        return err
                }
                diag.debugf("Collections.BlobSigning = %v", cluster.Collections.BlobSigning)
+               cfgOK = true
                return nil
        })
 
@@ -157,6 +159,11 @@ func (diag *diagnoser) runtests() {
                return nil
        })
 
+       if !cfgOK {
+               diag.errorf("cannot proceed without cluster config -- aborting without running any further tests")
+               return
+       }
+
        // uncomment to create some spurious errors
        // cluster.Services.WebDAVDownload.ExternalURL.Host = "0.0.0.0:9"