From 1fbf06f5ad2da7aa870dba82af6c3669c530c04f Mon Sep 17 00:00:00 2001 From: Hanna Lee Date: Thu, 15 Jul 2021 15:27:44 -0400 Subject: [PATCH] Use time.NewTicker instead of time.Tick to avoid leaking --- pkg/kubelet/status/status_manager.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkg/kubelet/status/status_manager.go b/pkg/kubelet/status/status_manager.go index 9c93a746b58..7ec6d2b51a8 100644 --- a/pkg/kubelet/status/status_manager.go +++ b/pkg/kubelet/status/status_manager.go @@ -157,8 +157,7 @@ func (m *manager) Start() { } klog.InfoS("Starting to sync pod status with apiserver") - //lint:ignore SA1015 Ticker can link since this is only called once and doesn't handle termination. - syncTicker := time.Tick(syncPeriod) + syncTicker := time.NewTicker(syncPeriod).C // syncPod and syncBatch share the same go routine to avoid sync races. go wait.Forever(func() { for {