Skip to content

Commit

Permalink
minor change
Browse files Browse the repository at this point in the history
Signed-off-by: chrismark <[email protected]>
  • Loading branch information
ChrsMark committed May 18, 2021
1 parent f52cb66 commit 6a4b0e7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions metricbeat/module/kubernetes/kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ type kubeStateMetricsCache struct {
lock sync.Mutex
}

func (c *kubeStateMetricsCache) initCacheMapEntry(hash uint64) *familiesCache {
func (c *kubeStateMetricsCache) getCacheMapEntry(hash uint64) *familiesCache {
c.lock.Lock()
defer c.lock.Unlock()
if _, ok := c.cacheMap[hash]; !ok {
Expand Down Expand Up @@ -80,7 +80,7 @@ func ModuleBuilder() func(base mb.BaseModule) (mb.Module, error) {
// NOTE: These entries will be never removed, this can be a leak if
// metricbeat is used to monitor clusters dynamically created.
// (https://github.com/elastic/beats/pull/25640#discussion_r633395213)
familiesCache := kubeStateMetricsCache.initCacheMapEntry(hash)
familiesCache := kubeStateMetricsCache.getCacheMapEntry(hash)
m := module{
BaseModule: base,
kubeStateMetricsCache: kubeStateMetricsCache,
Expand Down

0 comments on commit 6a4b0e7

Please sign in to comment.