From fa502f7616688af482e614e1a30cd6dd341e2dec Mon Sep 17 00:00:00 2001 From: Tom Clegg Date: Fri, 15 Jul 2022 12:02:48 -0400 Subject: [PATCH] 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 --- lib/diagnostics/cmd.go | 7 +++++++ 1 file changed, 7 insertions(+) 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" -- 2.30.2