Skip to content

Commit

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

(cherry picked from commit 936949d)
  • Loading branch information
jsoriano committed Nov 15, 2018
1 parent e7d3e54 commit 8efaf0b
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 @@ -51,6 +51,8 @@ https://github.com/elastic/beats/compare/v6.5.0...6.x[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 8efaf0b

Please sign in to comment.