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:
@@ -308,7 +308,7 @@ tailscale.com/cmd/tailscaled dependencies: (generated by github.com/tailscale/de
|
||||
tailscale.com/feature/runtimemetrics from tailscale.com/feature/condregister
|
||||
L tailscale.com/feature/sdnotify from tailscale.com/feature/condregister
|
||||
LD tailscale.com/feature/ssh from tailscale.com/cmd/tailscaled
|
||||
tailscale.com/feature/syspolicy from tailscale.com/feature/condregister+
|
||||
tailscale.com/feature/syspolicy from tailscale.com/feature/condregister
|
||||
tailscale.com/feature/taildrop from tailscale.com/feature/condregister
|
||||
tailscale.com/feature/tailnetlock from tailscale.com/feature/condregister
|
||||
L tailscale.com/feature/tap from tailscale.com/feature/condregister
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user