Skip to content

Commit e1939eb

Browse files
author
Xuewei Zhang
committed
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 kubernetes/apimachinery@10ebc22e for more detail.
1 parent 3fc6c7f commit e1939eb

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pkg/exporters/k8sexporter/condition/manager.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,11 @@ func (c *conditionManager) GetConditions() []types.Condition {
110110
}
111111

112112
func (c *conditionManager) syncLoop() {
113-
updateCh := c.clock.Tick(updatePeriod)
113+
ticker := c.clock.NewTicker(updatePeriod)
114+
defer ticker.Stop()
114115
for {
115116
select {
116-
case <-updateCh:
117+
case <-ticker.C():
117118
if c.needUpdates() || c.needResync() || c.needHeartbeat() {
118119
c.sync()
119120
}

0 commit comments

Comments
 (0)