mirror of
https://github.com/siderolabs/talos.git
synced 2026-05-05 04:16:21 +02:00
fix: reset the ticker when the KubeSpan is disabled/enabled
Fixes #13226 The issue was that that the ticker was stopped, but never set to `nil`, so that it was never re-created when the KubeSpan is enabled back again. Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
This commit is contained in:
parent
462015bcd9
commit
bd344fd53f
@ -119,6 +119,12 @@ func (ctrl *ManagerController) Run(ctx context.Context, r controller.Runtime, lo
|
||||
ticker *time.Ticker
|
||||
)
|
||||
|
||||
defer func() {
|
||||
if ticker != nil {
|
||||
ticker.Stop()
|
||||
}
|
||||
}()
|
||||
|
||||
if ctrl.WireguardClientFactory == nil {
|
||||
ctrl.WireguardClientFactory = func() (WireguardClient, error) {
|
||||
return wgctrl.New()
|
||||
@ -156,6 +162,7 @@ func (ctrl *ManagerController) Run(ctx context.Context, r controller.Runtime, lo
|
||||
if cfg == nil || !cfg.TypedSpec().Enabled {
|
||||
if ticker != nil {
|
||||
ticker.Stop()
|
||||
ticker = nil
|
||||
|
||||
tickerC = nil
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user