TUN-7004: Dont show local config dirs for remotely configured tuns

cloudflared shows possible directories for config files to be present if
it doesn't see one when starting up. For remotely configured files, it
may not be necessary to have a config file present. This PR looks to see
if a token flag was provided, and if yes, does not log this message.
This commit is contained in:
Sudarsan Reddy 2022-12-13 11:03:00 +00:00
parent 78ca8002d2
commit 7dee179652
1 changed files with 2 additions and 1 deletions

View File

@ -241,7 +241,8 @@ func StartServer(
listeners := gracenet.Net{}
errC := make(chan error)
if config.GetConfiguration().Source() == "" {
// Only log for locally configured tunnels (Token is blank).
if config.GetConfiguration().Source() == "" && c.String(TunnelTokenFlag) == "" {
log.Info().Msg(config.ErrNoConfigFile.Error())
}