From: Tom Clegg Date: Fri, 15 Jul 2022 16:02:48 +0000 (-0400) Subject: 17344: Give up early if cluster config cannot be fetched. X-Git-Tag: 2.5.0~115^2~8 X-Git-Url: https://git.arvados.org/arvados.git/commitdiff_plain/fa502f7616688af482e614e1a30cd6dd341e2dec 17344: Give up early if cluster config cannot be fetched. Avoids unhelpful noise, like "unsupported protocol scheme" trying to use an empty URL. Arvados-DCO-1.1-Signed-off-by: Tom Clegg --- diff --git a/lib/diagnostics/cmd.go b/lib/diagnostics/cmd.go index ed8d440b89..3455d3307e 100644 --- a/lib/diagnostics/cmd.go +++ b/lib/diagnostics/cmd.go @@ -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"