Skip to content

Commit

Permalink
[chore] fix exhaustive lint for attribute processor (open-telemetry#2…
Browse files Browse the repository at this point in the history
…3942)

**Description:** 
related open-telemetry#23266

---------

Signed-off-by: Ziqi Zhao <zhaoziqi9146@gmail.com>
  • Loading branch information
fatsheep9146 authored Jul 6, 2023
1 parent e5cd1ca commit ab5a083
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
3 changes: 0 additions & 3 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,6 @@ issues:
- path: statsdreceiver
linters:
- exhaustive
- path: attributesprocessor
linters:
- exhaustive
- path: cumulativetodeltaprocessor
linters:
- exhaustive
Expand Down
1 change: 1 addition & 0 deletions processor/attributesprocessor/attributes_metric.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,5 +91,6 @@ func (a *metricAttributesProcessor) processMetricAttributes(ctx context.Context,
for i := 0; i < dps.Len(); i++ {
a.attrProc.Process(ctx, a.logger, dps.At(i).Attributes())
}
case pmetric.MetricTypeEmpty:
}
}
2 changes: 2 additions & 0 deletions processor/k8sattributesprocessor/internal/kube/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -759,6 +759,8 @@ func selectorsFromFilters(filters Filters) (labels.Selector, fields.Selector, er
selectors = append(selectors, fields.OneTermEqualSelector(f.Key, f.Value))
case selection.NotEquals:
selectors = append(selectors, fields.OneTermNotEqualSelector(f.Key, f.Value))
case selection.DoesNotExist, selection.DoubleEquals, selection.In, selection.NotIn, selection.Exists, selection.GreaterThan, selection.LessThan:
fallthrough
default:
return nil, nil, fmt.Errorf("field filters don't support operator: '%s'", f.Op)
}
Expand Down
2 changes: 2 additions & 0 deletions processor/k8sattributesprocessor/processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,8 @@ func intFromAttribute(val pcommon.Value) (int, error) {
return 0, err
}
return i, nil
case pcommon.ValueTypeEmpty, pcommon.ValueTypeDouble, pcommon.ValueTypeBool, pcommon.ValueTypeMap, pcommon.ValueTypeSlice, pcommon.ValueTypeBytes:
fallthrough
default:
return 0, fmt.Errorf("wrong attribute type %v, expected int", val.Type())
}
Expand Down

0 comments on commit ab5a083

Please sign in to comment.