Skip to content

Commit 1cbc8fb

Browse files
committed
TUN-3220: tunnel route reports created route
1 parent edc6969 commit 1cbc8fb

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

cmd/cloudflared/tunnel/subcommands.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -548,6 +548,8 @@ func routeTunnel(c *cli.Context) error {
548548
return errors.Wrap(err, "Failed to route tunnel")
549549
}
550550

551+
logger.Infof(route.SuccessSummary())
552+
551553
return nil
552554
}
553555

tunnelstore/client.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ type Connection struct {
4444
type Route interface {
4545
json.Marshaler
4646
RecordType() string
47+
// SuccessSummary explains what will route to this tunnel when it's provisioned successfully
48+
SuccessSummary() string
4749
}
4850

4951
type DNSRoute struct {
@@ -71,6 +73,10 @@ func (dr *DNSRoute) RecordType() string {
7173
return "dns"
7274
}
7375

76+
func (dr *DNSRoute) SuccessSummary() string {
77+
return fmt.Sprintf("%s will route to your tunnel", dr.userHostname)
78+
}
79+
7480
type LBRoute struct {
7581
lbName string
7682
lbPool string
@@ -100,6 +106,10 @@ func (lr *LBRoute) RecordType() string {
100106
return "lb"
101107
}
102108

109+
func (lr *LBRoute) SuccessSummary() string {
110+
return fmt.Sprintf("Load balancer %s will route to this tunnel through pool %s", lr.lbName, lr.lbPool)
111+
}
112+
103113
type Client interface {
104114
CreateTunnel(name string, tunnelSecret []byte) (*Tunnel, error)
105115
GetTunnel(tunnelID uuid.UUID) (*Tunnel, error)

0 commit comments

Comments
 (0)