Repository navigation
cmd/containerboot: ensure that --advertise-routes can be unset - #10734
Conversation
5eb9086 to
c46940e
Compare
| @@ -651,6 +651,8 @@ func tailscaleUp(ctx context.Context, cfg *settings) error { | |||
| } | |||
| if cfg.Routes != "" { | |||
There was a problem hiding this comment.
Could also convert this into a pointer and have the three states. Unset, set and empty.
There was a problem hiding this comment.
I was thinking about sth like that, but then that would be inconsistent with the acceptDNS for example where, if it's unset we treat it the same as explicitly set to false. Or is that not a good comparison
There was a problem hiding this comment.
just thinking about the backwards compat problem, not sure if its applicable here
There was a problem hiding this comment.
I can't think of a standard flow where this would be set once and not again. Maybe there is some mystery reason for someone to, instead of providing the value via env var, to ssh to the container at a specific point in time and expose a route that way, not sure why anyone would do that, but we'd probably break that
There was a problem hiding this comment.
yeah, I guess there isn't a particular reason to unset the subnet routes if the env var is not provided because we again assume that the standard flow would have all config opts. So maybe it's more valuable to have the 3 values for backwards compat
There was a problem hiding this comment.
should be better now
6ce669b to
90fbce1
Compare
A Tailnet node can be told to stop advertise subnets by passing an empty string to --advertise-routes flag. Respect an explicitly passed empty value to TS_ROUTES env var so that users have a way to stop containerboot acting as a subnet router without recreating it. Distinguish between TS_ROUTES being unset and empty. Updates #10708 Signed-off-by: Irbe Krumina <[email protected]>
90fbce1 to
fdbbf9e
Compare
…#10734) A Tailnet node can be told to stop advertise subnets by passing an empty string to --advertise-routes flag. Respect an explicitly passed empty value to TS_ROUTES env var so that users have a way to stop containerboot acting as a subnet router without recreating it. Distinguish between TS_ROUTES being unset and empty. Updates tailscale#10708 Signed-off-by: Irbe Krumina <[email protected]>
A Tailnet node can be told to stop advertise subnets by passing an empty string to
--advertise-routesflag totailscale up/tailscale set.containerboot currently ignores
TS_ROUTESif it's set to empty string, which means that the only way to stop a containerised tailscale withTS_AUTH_ONCEset to true would be to recreate it (if it's not created withTS_AUTH_ONCEthis can probably be achieved by passing--advertise-routestoTS_EXTRA_ARGSinstead (?)).This would cause issues for #10724 where we need to be able to update a Tailnet node corresponding to a
Connectorcustom resource to be/not be a subnet router as users updateConnectorspec.This PR ensures that if
TS_ROUTESis explicitly set to an empty value a--advertise-routes=is passed totailscale up/tailscale setso that if the node is currently acting as a subnet router it will no longer do that.Updates #10708