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")
|
return errors.Wrap(err, "Failed to route tunnel")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
logger.Infof(route.SuccessSummary())
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -44,6 +44,8 @@ type Connection struct {
|
||||||
type Route interface {
|
type Route interface {
|
||||||
json.Marshaler
|
json.Marshaler
|
||||||
RecordType() string
|
RecordType() string
|
||||||
|
// SuccessSummary explains what will route to this tunnel when it's provisioned successfully
|
||||||
|
SuccessSummary() string
|
||||||
}
|
}
|
||||||
|
|
||||||
type DNSRoute struct {
|
type DNSRoute struct {
|
||||||
|
@ -71,6 +73,10 @@ func (dr *DNSRoute) RecordType() string {
|
||||||
return "dns"
|
return "dns"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (dr *DNSRoute) SuccessSummary() string {
|
||||||
|
return fmt.Sprintf("%s will route to your tunnel", dr.userHostname)
|
||||||
|
}
|
||||||
|
|
||||||
type LBRoute struct {
|
type LBRoute struct {
|
||||||
lbName string
|
lbName string
|
||||||
lbPool string
|
lbPool string
|
||||||
|
@ -100,6 +106,10 @@ func (lr *LBRoute) RecordType() string {
|
||||||
return "lb"
|
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 {
|
type Client interface {
|
||||||
CreateTunnel(name string, tunnelSecret []byte) (*Tunnel, error)
|
CreateTunnel(name string, tunnelSecret []byte) (*Tunnel, error)
|
||||||
GetTunnel(tunnelID uuid.UUID) (*Tunnel, error)
|
GetTunnel(tunnelID uuid.UUID) (*Tunnel, error)
|
||||||
|
|
Loading…
Reference in New Issue