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:
@@ -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