TUN-3377: Tunnel route should check dns/lb before checking tunnel ID
This commit is contained in:
parent
8764fbfdfa
commit
218ee30206
|
@ -412,20 +412,25 @@ func routeCommand(c *cli.Context) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
const tunnelIDIndex = 1
|
const tunnelIDIndex = 1
|
||||||
tunnelID, err := sc.findID(c.Args().Get(tunnelIDIndex))
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
routeType := c.Args().First()
|
routeType := c.Args().First()
|
||||||
var r tunnelstore.Route
|
var r tunnelstore.Route
|
||||||
|
var tunnelID uuid.UUID
|
||||||
switch routeType {
|
switch routeType {
|
||||||
case "dns":
|
case "dns":
|
||||||
|
tunnelID, err = sc.findID(c.Args().Get(tunnelIDIndex))
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
r, err = dnsRouteFromArg(c, tunnelID)
|
r, err = dnsRouteFromArg(c, tunnelID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
case "lb":
|
case "lb":
|
||||||
|
tunnelID, err = sc.findID(c.Args().Get(tunnelIDIndex))
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
r, err = lbRouteFromArg(c, tunnelID)
|
r, err = lbRouteFromArg(c, tunnelID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
Loading…
Reference in New Issue