Skip to content

Commit

Permalink
Fix race condition when enriching events with Kubernetes metadata (el…
Browse files Browse the repository at this point in the history
…astic#9067)

(cherry picked from commit 936949d)
  • Loading branch information
jsoriano committed Nov 14, 2018
1 parent 2f7c62c commit 1daf01c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ https://github.com/elastic/beats/compare/v6.5.0...6.5[Check the HEAD diff]

*Metricbeat*

- Fix race condition when enriching events with kubernetes metadata. {issue}9055[9055] {issue}9067[9067]

*Packetbeat*

*Winlogbeat*
Expand Down
2 changes: 2 additions & 0 deletions metricbeat/module/kubernetes/util/kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,8 @@ func (m *enricher) Stop() {
}

func (m *enricher) Enrich(events []common.MapStr) {
m.RLock()
defer m.RUnlock()
for _, event := range events {
if meta := m.metadata[m.index(event)]; meta != nil {
event.DeepUpdate(common.MapStr{
Expand Down

0 comments on commit 1daf01c

Please sign in to comment.