Skip to content

Commit

Permalink
Update m.clusterMeta comparison to nil
Browse files Browse the repository at this point in the history
  • Loading branch information
constanca-m committed Jan 4, 2023
1 parent 2549538 commit ddd3ba2
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion metricbeat/module/kubernetes/apiserver/metricset.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func (m *Metricset) Fetch(reporter mb.ReporterV2) error {

for _, e := range events {
event := mb.TransformMapStrToEvent("kubernetes", e, nil)
if m.clusterMeta != nil {
if len(m.clusterMeta) != 0 {
event.RootFields.DeepUpdate(m.clusterMeta)
}
isOpen := reporter.Event(event)
Expand Down
2 changes: 1 addition & 1 deletion metricbeat/module/kubernetes/system/system.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func (m *MetricSet) Fetch(reporter mb.ReporterV2) error {

for _, e := range events {
event := mb.TransformMapStrToEvent("kubernetes", e, nil)
if m.clusterMeta != nil {
if len(m.clusterMeta) != 0 {
event.RootFields.DeepUpdate(m.clusterMeta)
}
isOpen := reporter.Event(event)
Expand Down
2 changes: 1 addition & 1 deletion metricbeat/module/kubernetes/volume/volume.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func (m *MetricSet) Fetch(reporter mb.ReporterV2) error {
}
for _, e := range events {
event := mb.TransformMapStrToEvent("kubernetes", e, nil)
if m.clusterMeta != nil {
if len(m.clusterMeta) != 0 {
event.RootFields.DeepUpdate(m.clusterMeta)
}
isOpen := reporter.Event(event)
Expand Down

0 comments on commit ddd3ba2

Please sign in to comment.