From: Tom Clegg Date: Thu, 27 Oct 2022 14:07:43 +0000 (-0400) Subject: 19377: Usage error if config is readable but does not match env. X-Git-Tag: 2.5.0~50^2 X-Git-Url: https://git.arvados.org/arvados.git/commitdiff_plain/d5df19fdff62724f9faeb3bee17201363071bf9e 19377: Usage error if config is readable but does not match env. Arvados-DCO-1.1-Signed-off-by: Tom Clegg --- 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()