diff --git a/cli/command/registry.go b/cli/command/registry.go index c86edcc79f..90189b9482 100644 --- a/cli/command/registry.go +++ b/cli/command/registry.go @@ -29,11 +29,16 @@ func ElectAuthServer(ctx context.Context, cli Cli) string { // example a Linux client might be interacting with a Windows daemon, hence // the default registry URL might be Windows specific. serverAddress := registry.IndexServer - if info, err := cli.Client().Info(ctx); err != nil && debug.IsEnabled() { - // Only report the warning if we're in debug mode to prevent nagging during engine initialization workflows - fmt.Fprintf(cli.Err(), "Warning: failed to get default registry endpoint from daemon (%v). Using system default: %s\n", err, serverAddress) - } else if info.IndexServerAddress == "" && debug.IsEnabled() { - fmt.Fprintf(cli.Err(), "Warning: Empty registry endpoint from daemon. Using system default: %s\n", serverAddress) + if info, err := cli.Client().Info(ctx); err != nil { + // Daemon is not responding so use system default. + if debug.IsEnabled() { + // Only report the warning if we're in debug mode to prevent nagging during engine initialization workflows + fmt.Fprintf(cli.Err(), "Warning: failed to get default registry endpoint from daemon (%v). Using system default: %s\n", err, serverAddress) + } + } else if info.IndexServerAddress == "" { + if debug.IsEnabled() { + fmt.Fprintf(cli.Err(), "Warning: Empty registry endpoint from daemon. Using system default: %s\n", serverAddress) + } } else { serverAddress = info.IndexServerAddress }