Skip to content

Commit

Permalink
[chore] add pod.container test (open-telemetry#37634)
Browse files Browse the repository at this point in the history
Add code coverage of pod.container rule type.
  • Loading branch information
atoulme authored Feb 5, 2025
1 parent 86430c5 commit 6638b83
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion receiver/receivercreator/fixtures_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ var podContainerEndpointWithHints = observer.Endpoint{
ID: "namespace/pod-2-UID/redis(6379)",
Target: "1.2.3.4:6379",
Details: &observer.PodContainer{
Name: "redis", Pod: observer.Pod{
Image: "redis",
Name: "redis", Pod: observer.Pod{
Name: "pod-2",
Namespace: "default",
UID: "pod-2-UID",
Expand Down
1 change: 1 addition & 0 deletions receiver/receivercreator/rules_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ func Test_ruleEval(t *testing.T) {
{"basic container", args{`type == "container" && labels["region"] == "east-1"`, containerEndpoint}, true, false},
{"basic k8s.node", args{`type == "k8s.node" && kubelet_endpoint_port == 10250`, k8sNodeEndpoint}, true, false},
{"relocated type builtin", args{`type == "k8s.node" && typeOf("some string") == "string"`, k8sNodeEndpoint}, true, false},
{"pod container", args{`type == "pod.container" and container_image matches "redis"`, podContainerEndpointWithHints}, true, false},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
Expand Down

0 comments on commit 6638b83

Please sign in to comment.