Worker: log which URLs were tried when auto-discovery failed

When the Worker cannot find any Manager, log which URLs were tried.
This commit is contained in:
Sybren A. Stüvel 2022-07-18 14:14:02 +02:00
parent ad57070a2d
commit e91623557a

View File

@ -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: