logpolicy,tsnet: remove syspolicy dependency

tsnet depends on logpolicy, which in turn depended on util/syspolicy
because of a single LogTarget policy setting it uses.

In this commit, we replace that dependency with a feature.Hook,
which only tailscaled or its platform-specific alternatives should set.

Updates #20031

Signed-off-by: Nick Khyl <nickk@tailscale.com>
This commit is contained in:
Nick Khyl
2026-06-05 16:21:27 -05:00
committed by Nick Khyl
parent eda975a9e4
commit c0d0621417
8 changed files with 30 additions and 33 deletions
+4
View File
@@ -438,6 +438,10 @@ func run() (err error) {
var publicLogID logid.PublicID
if buildfeatures.HasLogTail {
logpolicy.GetLogTarget.Set(func() string {
target, _ := sys.PolicyClientOrDefault().GetString(pkey.LogTarget, "")
return target
})
pol := logpolicy.Options{
Collection: logtail.CollectionNode,