mirror of
https://github.com/tailscale/tailscale.git
synced 2025-12-02 16:01:27 +01:00
ipn/ipnlocal: test traffic-steering when feature is not enabled (#17997)
In PR tailscale/corp#34401, the `traffic-steering` feature flag does not automatically enable traffic steering for all nodes. Instead, an admin must add the `traffic-steering` node attribute to each client node that they want opted-in. For backwards compatibility with older clients, tailscale/corp#34401 strips out the `traffic-steering` node attribute if the feature flag is not enabled, even if it is set in the policy file. This lets us safely disable the feature flag. This PR adds a missing test case for suggested exit nodes that have no priority. Updates tailscale/corp#34399 Signed-off-by: Simon Law <sfllaw@tailscale.com>
This commit is contained in:
parent
7073f246d3
commit
848978e664
@ -7301,6 +7301,9 @@ func suggestExitNode(report *netcheck.Report, nb *nodeBackend, prevSuggestion ta
|
|||||||
// The traffic-steering feature flag is enabled on this tailnet.
|
// The traffic-steering feature flag is enabled on this tailnet.
|
||||||
return suggestExitNodeUsingTrafficSteering(nb, allowList)
|
return suggestExitNodeUsingTrafficSteering(nb, allowList)
|
||||||
default:
|
default:
|
||||||
|
// The control plane will always strip the `traffic-steering`
|
||||||
|
// node attribute if it isn’t enabled for this tailnet, even if
|
||||||
|
// it is set in the policy file: tailscale/corp#34401
|
||||||
return suggestExitNodeUsingDERP(report, nb, prevSuggestion, selectRegion, selectNode, allowList)
|
return suggestExitNodeUsingDERP(report, nb, prevSuggestion, selectRegion, selectNode, allowList)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5173,6 +5173,26 @@ func TestSuggestExitNodeTrafficSteering(t *testing.T) {
|
|||||||
wantID: "stable3",
|
wantID: "stable3",
|
||||||
wantName: "peer3",
|
wantName: "peer3",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "exit-nodes-without-priority-for-suggestions",
|
||||||
|
netMap: &netmap.NetworkMap{
|
||||||
|
SelfNode: selfNode.View(),
|
||||||
|
Peers: []tailcfg.NodeView{
|
||||||
|
makePeer(1,
|
||||||
|
withExitRoutes(),
|
||||||
|
withSuggest()),
|
||||||
|
makePeer(2,
|
||||||
|
withExitRoutes(),
|
||||||
|
withSuggest()),
|
||||||
|
makePeer(3,
|
||||||
|
withExitRoutes(),
|
||||||
|
withLocationPriority(1)),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
wantID: "stable1",
|
||||||
|
wantName: "peer1",
|
||||||
|
wantPri: 0,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: "exit-nodes-with-and-without-priority",
|
name: "exit-nodes-with-and-without-priority",
|
||||||
netMap: &netmap.NetworkMap{
|
netMap: &netmap.NetworkMap{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user