Skip to content

Commit

Permalink
Fix docker observer
Browse files Browse the repository at this point in the history
  • Loading branch information
atoulme committed Mar 25, 2024
1 parent 7e1f0cc commit 81c16ca
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/general/discoverymode/docker_observer_discovery_test.go
Expand Up @@ -152,6 +152,11 @@ func TestDockerObserver(t *testing.T) {
"resource_attributes": map[string]any{},
"rule": `type == "container" and labels['test.id'] == '${SPLUNK_TEST_ID}' and port == 9090`,
},
"redis": map[string]any{
"config": map[string]any{},
"resource_attributes": map[string]any{},
"rule": "type == \"container\" and any([name, image, command], {# matches \"(?i)redis\"}) and not (command matches \"splunk.discovery\")",
},
},
"watch_observers": []any{"docker_observer"},
},
Expand Down Expand Up @@ -228,6 +233,11 @@ func TestDockerObserver(t *testing.T) {
"resource_attributes": map[string]any{},
"rule": fmt.Sprintf(`type == "container" and labels['test.id'] == '%s' and port == 9090`, tc.ID),
},
"redis": map[string]any{
"config": map[string]any{},
"resource_attributes": map[string]any{},
"rule": "type == \"container\" and any([name, image, command], {# matches \"(?i)redis\"}) and not (command matches \"splunk.discovery\")",
},
},
"watch_observers": []any{"docker_observer"},
},
Expand Down Expand Up @@ -277,6 +287,11 @@ receivers:
resource_attributes: {}
rule: type == "container" and labels['test.id'] == '${SPLUNK_TEST_ID}' and
port == 9090
redis:
config: {}
resource_attributes: {}
rule: type == "container" and any([name, image, command], {# matches "(?i)redis"})
and not (command matches "splunk.discovery")
watch_observers:
- docker_observer
service:
Expand Down

0 comments on commit 81c16ca

Please sign in to comment.