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:
parent
ad57070a2d
commit
e91623557a
@ -7,6 +7,7 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"net/url"
|
"net/url"
|
||||||
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@ -64,7 +65,8 @@ func AutodiscoverManager(ctx context.Context) (string, error) {
|
|||||||
|
|
||||||
switch len(usableURLs) {
|
switch len(usableURLs) {
|
||||||
case 0:
|
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:
|
case 1:
|
||||||
log.Info().Str("url", usableURLs[0]).Msg("found Manager")
|
log.Info().Str("url", usableURLs[0]).Msg("found Manager")
|
||||||
default:
|
default:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user