Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[chore] add pod.container test #37634

Merged
merged 1 commit into from
Feb 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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