code: func ElectAuthServer(ctx context.Context, cli Cli) string {
  	// The daemon `/info` endpoint informs us of the default registry being
  	// used. This is essential in cross-platforms environment, where for
  	// example a Linux client might be interacting with a Windows daemon, hence
  	// the default registry URL might be Windows specific.
  	info, err := cli.Client().Info(ctx)
  	if 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, registry.IndexServer)
  		}
  		return registry.IndexServer
  	}
  	if info.IndexServerAddress == "" {
  		if debug.IsEnabled() {
  			fmt.Fprintf(cli.Err(), "Warning: Empty registry endpoint from daemon. Using system default: %s\n", registry.IndexServer)
  		}
  		return registry.IndexServer
  	}
  	return info.IndexServerAddress
  }
docs: // ElectAuthServer returns the default registry to use (by asking the daemon)