mirror of
https://github.com/kubernetes/node-problem-detector.git
synced 2026-03-25 12:57:15 +00:00
Handle vendor change in k8s.io/apimachinery/pkg/util/clock
clock.Clock used to have Tick() method, but is now replaced with NewTicker() method to prevent leaking. Changed NPD code to adapt to it. See https://github.com/kubernetes/apimachinery/commit/10ebc22e for more detail.
This commit is contained in:
@@ -110,10 +110,11 @@ func (c *conditionManager) GetConditions() []types.Condition {
|
||||
}
|
||||
|
||||
func (c *conditionManager) syncLoop() {
|
||||
updateCh := c.clock.Tick(updatePeriod)
|
||||
ticker := c.clock.NewTicker(updatePeriod)
|
||||
defer ticker.Stop()
|
||||
for {
|
||||
select {
|
||||
case <-updateCh:
|
||||
case <-ticker.C():
|
||||
if c.needUpdates() || c.needResync() || c.needHeartbeat() {
|
||||
c.sync()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user