Documentation
¶
Overview ¶
Package withdraw uses local and cloud Tailscale APIs to withdraw a route from a Tailnet.
It uses the local API to withdraw the route to peers. Then it uses the Tailscale Cloud API to confirm the newly withdrawn route.
This is provided in a way to optimize the testable surface area (even for untested parts of the code) without having any usage of `os.Exit()`.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DisableWithdrawnCIDR ¶
func DisableWithdrawnCIDR(ctx context.Context, c cloud.Config, cidr netaddr.IPPrefix, hostname string) error
DisableWithdrawnCIDR ensures that a recently withdrawn CIDR is removed from the set of enabled routes in the Tailscale cloud API.
func EditPrefsWithdrawCIDR ¶
EditPrefsWithdrawCIDR updates existing Tailscale preferences to withdraw a routes advertised by the current Tailscale node.
If the accept routes flag and the advertised CIDR are both present, this will make no changes.