TUN-3220: tunnel route reports created route
This commit is contained in:
parent
edc69694cb
commit
1cbc8fb8ac
|
@ -548,6 +548,8 @@ func routeTunnel(c *cli.Context) error {
|
|||
return errors.Wrap(err, "Failed to route tunnel")
|
||||
}
|
||||
|
||||
logger.Infof(route.SuccessSummary())
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
|
@ -44,6 +44,8 @@ type Connection struct {
|
|||
type Route interface {
|
||||
json.Marshaler
|
||||
RecordType() string
|
||||
// SuccessSummary explains what will route to this tunnel when it's provisioned successfully
|
||||
SuccessSummary() string
|
||||
}
|
||||
|
||||
type DNSRoute struct {
|
||||
|
@ -71,6 +73,10 @@ func (dr *DNSRoute) RecordType() string {
|
|||
return "dns"
|
||||
}
|
||||
|
||||
func (dr *DNSRoute) SuccessSummary() string {
|
||||
return fmt.Sprintf("%s will route to your tunnel", dr.userHostname)
|
||||
}
|
||||
|
||||
type LBRoute struct {
|
||||
lbName string
|
||||
lbPool string
|
||||
|
@ -100,6 +106,10 @@ func (lr *LBRoute) RecordType() string {
|
|||
return "lb"
|
||||
}
|
||||
|
||||
func (lr *LBRoute) SuccessSummary() string {
|
||||
return fmt.Sprintf("Load balancer %s will route to this tunnel through pool %s", lr.lbName, lr.lbPool)
|
||||
}
|
||||
|
||||
type Client interface {
|
||||
CreateTunnel(name string, tunnelSecret []byte) (*Tunnel, error)
|
||||
GetTunnel(tunnelID uuid.UUID) (*Tunnel, error)
|
||||
|
|
Loading…
Reference in New Issue