Skip to content
This repository was archived by the owner on May 28, 2022. It is now read-only.

Commit 8250b67

Browse files
committed
TUN-4111: Warn the user if both properties "tunnel" and "hostname" are used
1 parent db5c6f2 commit 8250b67

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

cmd/cloudflared/tunnel/configuration.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,10 @@ func prepareTunnelConfig(
160160
if err != nil {
161161
log.Err(err).Str(LogFieldHostname, configHostname).Msg("Invalid hostname")
162162
return nil, ingress.Ingress{}, errors.Wrap(err, "Invalid hostname")
163+
} else if hostname != "" && isNamedTunnel {
164+
log.Warn().Msg("The property `hostname` in your configuration is ignored because you configured a Named Tunnel " +
165+
"in the property `tunnel`. Make sure to provision the routing (e.g. via `cloudflared tunnel route`) or else " +
166+
"your origin will not be reachable. You should remove the `hostname` property to avoid this warning.")
163167
}
164168
isFreeTunnel := hostname == ""
165169
clientID := c.String("id")

0 commit comments

Comments
 (0)