From e91623557a5517690370ec51ad84497376767bd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Mon, 18 Jul 2022 14:14:02 +0200 Subject: [PATCH] Worker: log which URLs were tried when auto-discovery failed When the Worker cannot find any Manager, log which URLs were tried. --- internal/worker/autodiscovery.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/worker/autodiscovery.go b/internal/worker/autodiscovery.go index 2fbbb771..09b80f43 100644 --- a/internal/worker/autodiscovery.go +++ b/internal/worker/autodiscovery.go @@ -7,6 +7,7 @@ import ( "errors" "fmt" "net/url" + "strings" "sync" "time" @@ -64,7 +65,8 @@ func AutodiscoverManager(ctx context.Context) (string, error) { switch len(usableURLs) { case 0: - return "", fmt.Errorf("autodetected %d URLs, but none were usable", len(urls)) + urlsAsString := strings.Join(urls, ", ") + return "", fmt.Errorf("autodetected %d URLs (%s), but none were usable", len(urls), urlsAsString) case 1: log.Info().Str("url", usableURLs[0]).Msg("found Manager") default: