mirror of
https://github.com/tailscale/tailscale.git
synced 2025-08-14 23:17:29 +00:00
ipn/ipnext: remove support for unregistering extension
Updates #12614 Change-Id: I893e3ea74831deaa6f88e31bba2d95dc017e0470 Co-authored-by: Nick Khyl <nickk@tailscale.com> Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:

committed by
Brad Fitzpatrick

parent
cb7bf929aa
commit
25c4dc5fd7
@@ -36,8 +36,6 @@ func init() {
|
||||
type extension struct {
|
||||
logf logger.Logf
|
||||
|
||||
// cleanup are functions to call on shutdown.
|
||||
cleanup []func()
|
||||
// store is the log store shared by all loggers.
|
||||
// It is created when the first logger is started.
|
||||
store lazy.SyncValue[LogStore]
|
||||
@@ -66,11 +64,9 @@ func (e *extension) Name() string {
|
||||
// Init implements [ipnext.Extension] by registering callbacks and providers
|
||||
// for the duration of the extension's lifetime.
|
||||
func (e *extension) Init(h ipnext.Host) error {
|
||||
e.cleanup = []func(){
|
||||
h.RegisterControlClientCallback(e.controlClientChanged),
|
||||
h.Profiles().RegisterProfileStateChangeCallback(e.profileChanged),
|
||||
h.RegisterAuditLogProvider(e.getCurrentLogger),
|
||||
}
|
||||
h.RegisterControlClientCallback(e.controlClientChanged)
|
||||
h.Profiles().RegisterProfileStateChangeCallback(e.profileChanged)
|
||||
h.RegisterAuditLogProvider(e.getCurrentLogger)
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -190,9 +186,5 @@ func (e *extension) getCurrentLogger() ipnauth.AuditLogFunc {
|
||||
|
||||
// Shutdown implements [ipnlocal.Extension].
|
||||
func (e *extension) Shutdown() error {
|
||||
for _, f := range e.cleanup {
|
||||
f()
|
||||
}
|
||||
e.cleanup = nil
|
||||
return nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user