Skip to content

Commit e11df2f

Browse files
jonyhy96k8s-publishing-bot
authored andcommitted
fix: npe when renew hiddenCollectors
Signed-off-by: haoyun <yun.hao@daocloud.io> Kubernetes-commit: 1a21a53f7e84e30915e15b4945ad08b5b3ca747b
1 parent b650297 commit e11df2f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

metrics/registry.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ func (kr *kubeRegistry) enableHiddenCollectors() {
274274
cs = append(cs, c)
275275
}
276276

277-
kr.hiddenCollectors = nil
277+
kr.hiddenCollectors = make(map[string]Registerable)
278278
kr.hiddenCollectorsLock.Unlock()
279279
kr.MustRegister(cs...)
280280
}

0 commit comments

Comments
 (0)