TUN-4111: Warn the user if both properties "tunnel" and "hostname" are used

This commit is contained in:
Nuno Diegues 2021-03-23 14:52:37 +00:00
parent db5c6f2556
commit 8250b67a9f
1 changed files with 4 additions and 0 deletions

View File

@ -160,6 +160,10 @@ func prepareTunnelConfig(
if err != nil {
log.Err(err).Str(LogFieldHostname, configHostname).Msg("Invalid hostname")
return nil, ingress.Ingress{}, errors.Wrap(err, "Invalid hostname")
} else if hostname != "" && isNamedTunnel {
log.Warn().Msg("The property `hostname` in your configuration is ignored because you configured a Named Tunnel " +
"in the property `tunnel`. Make sure to provision the routing (e.g. via `cloudflared tunnel route`) or else " +
"your origin will not be reachable. You should remove the `hostname` property to avoid this warning.")
}
isFreeTunnel := hostname == ""
clientID := c.String("id")