summaryrefslogtreecommitdiffhomepage
path: root/control/controlknobs/controlknobs.go
diff options
context:
space:
mode:
authorBrad Fitzpatrick <bradfitz@tailscale.com>2024-03-23 16:23:59 -0700
committerBrad Fitzpatrick <brad@danga.com>2024-03-24 21:08:46 -0700
commit7b34154df221f5613b397226a0b2a9109d183ad7 (patch)
tree89b2f7905e9e3111c76d5c4ec7590a31c7ffe0af /control/controlknobs/controlknobs.go
parent4992aca6ecc632c0722800a4901afe621f0641d0 (diff)
downloadtailscale-7b34154df221f5613b397226a0b2a9109d183ad7.tar.xz
tailscale-7b34154df221f5613b397226a0b2a9109d183ad7.zip
all: deprecate Node.Capabilities (more), remove PeerChange.Capabilities [capver 89]
First we had Capabilities []string. Then https://tailscale.com/blog/acl-grants (#4217) brought CapMap, a superset of Capabilities. Except we never really finished the transition inside the codebase to go all-in on CapMap. This does so. Notably, this coverts Capabilities on the wire early to CapMap internally so the code can only deal in CapMap, even against an old control server. In the process, this removes PeerChange.Capabilities support, which no known control plane sent anyway. They can and should use PeerChange.CapMap instead. Updates #11508 Updates #4217 Change-Id: I872074e226b873f9a578d9603897b831d50b25d9 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
Diffstat (limited to 'control/controlknobs/controlknobs.go')
-rw-r--r--control/controlknobs/controlknobs.go8
1 files changed, 2 insertions, 6 deletions
diff --git a/control/controlknobs/controlknobs.go b/control/controlknobs/controlknobs.go
index 6a36c9261..6e3a62967 100644
--- a/control/controlknobs/controlknobs.go
+++ b/control/controlknobs/controlknobs.go
@@ -6,7 +6,6 @@
package controlknobs
import (
- "slices"
"sync/atomic"
"tailscale.com/syncs"
@@ -77,14 +76,11 @@ type Knobs struct {
// UpdateFromNodeAttributes updates k (if non-nil) based on the provided self
// node attributes (Node.Capabilities).
-func (k *Knobs) UpdateFromNodeAttributes(selfNodeAttrs []tailcfg.NodeCapability, capMap tailcfg.NodeCapMap) {
+func (k *Knobs) UpdateFromNodeAttributes(capMap tailcfg.NodeCapMap) {
if k == nil {
return
}
- has := func(attr tailcfg.NodeCapability) bool {
- _, ok := capMap[attr]
- return ok || slices.Contains(selfNodeAttrs, attr)
- }
+ has := capMap.Contains
var (
keepFullWG = has(tailcfg.NodeAttrDebugDisableWGTrim)
disableDRPO = has(tailcfg.NodeAttrDebugDisableDRPO)