From d5df19fdff62724f9faeb3bee17201363071bf9e Mon Sep 17 00:00:00 2001 From: Tom Clegg Date: Thu, 27 Oct 2022 10:07:43 -0400 Subject: [PATCH] 19377: Usage error if config is readable but does not match env. Arvados-DCO-1.1-Signed-off-by: Tom Clegg --- lib/diagnostics/cmd.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/diagnostics/cmd.go b/lib/diagnostics/cmd.go index c944db6660..9c229c9b4e 100644 --- a/lib/diagnostics/cmd.go +++ b/lib/diagnostics/cmd.go @@ -157,8 +157,7 @@ func (diag *diagnoser) runtests() { return err } if cluster.SystemRootToken != os.Getenv("ARVADOS_API_TOKEN") { - diag.infof("skipping because SystemRootToken read from %s does not match $ARVADOS_API_TOKEN (consider using 'arvados-client sudo diagnostics' to load endpoint and token from config file instead of environment)", ldr.Path) - return nil + return fmt.Errorf("diagnostics usage error: %s is readable but SystemRootToken does not match $ARVADOS_API_TOKEN (to fix, either run 'arvados-client sudo diagnostics' to load everything from config file, or set ARVADOS_CONFIG=- to load nothing from config file)", ldr.Path) } agg := &health.Aggregator{Cluster: cluster} resp := agg.ClusterHealth() -- 2.30.2