Skip to content

Commit 3fc58ac

Browse files
committed
fix: spam filter fixtures , docs and tests
1 parent f6dba66 commit 3fc58ac

7 files changed

Lines changed: 45 additions & 44 deletions

File tree

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Use this changelog template to create an entry for release notes.
2+
3+
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
4+
change_type: bug_fix
5+
6+
# The name of the component, or a single word describing the area of concern (e.g. dashboards, config, apply)
7+
component: spam-filters
8+
9+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
10+
note: Fix spam filter FilterCriteria format in fixtures and tests to match the Dash0 API schema
11+
12+
# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
13+
issues: [134]
14+
15+
# (Optional) One or more lines of additional information to render under the primary note.
16+
# These lines will be padded with 2 spaces and then inserted directly into the document.
17+
# Use pipe (|) for multiline entries.
18+
subtext: |
19+
The filter criteria now use the correct flat format with `operator` and `value` fields instead of the nested `stringValue` format.
20+
21+
# If your change doesn't affect end users or the exported elements of any package,
22+
# you should instead start your pull request title with "chore" or use the "Skip Changelog" label.
23+
# Optional: The change log or logs in which this entry should be included.
24+
# e.g. '[user]' or '[user, api]'
25+
# Include 'user' if the change is relevant to end users.
26+
# Default: '[user]'
27+
change_logs: []

internal/spamfilters/integration_test.go

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -273,10 +273,8 @@ spec:
273273
- log
274274
filter:
275275
- key: "k8s.namespace.name"
276-
value:
277-
stringValue:
278-
operator: "equals"
279-
comparisonValue: "kube-system"
276+
operator: "is"
277+
value: "kube-system"
280278
`), 0644)
281279
require.NoError(t, err)
282280

@@ -321,10 +319,8 @@ spec:
321319
- log
322320
filter:
323321
- key: "k8s.namespace.name"
324-
value:
325-
stringValue:
326-
operator: "equals"
327-
comparisonValue: "kube-system"
322+
operator: "is"
323+
value: "kube-system"
328324
`), 0644)
329325
require.NoError(t, err)
330326

internal/spamfilters/update_integration_test.go

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,8 @@ spec:
3737
- log
3838
filter:
3939
- key: "k8s.namespace.name"
40-
value:
41-
stringValue:
42-
operator: "equals"
43-
comparisonValue: "kube-system"
40+
operator: "is"
41+
value: "kube-system"
4442
`), 0644)
4543
require.NoError(t, err)
4644

@@ -68,10 +66,8 @@ spec:
6866
- log
6967
filter:
7068
- key: "k8s.namespace.name"
71-
value:
72-
stringValue:
73-
operator: "equals"
74-
comparisonValue: "kube-system"
69+
operator: "is"
70+
value: "kube-system"
7571
`), 0644)
7672
require.NoError(t, err)
7773

internal/testutil/fixtures/spamfilters/create_success.json

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,8 @@
1717
"filter": [
1818
{
1919
"key": "k8s.namespace.name",
20-
"value": {
21-
"stringValue": {
22-
"operator": "equals",
23-
"comparisonValue": "kube-system"
24-
}
25-
}
20+
"operator": "is",
21+
"value": "kube-system"
2622
}
2723
]
2824
}

internal/testutil/fixtures/spamfilters/get_success.json

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,8 @@
1717
"filter": [
1818
{
1919
"key": "k8s.namespace.name",
20-
"value": {
21-
"stringValue": {
22-
"operator": "equals",
23-
"comparisonValue": "kube-system"
24-
}
25-
}
20+
"operator": "is",
21+
"value": "kube-system"
2622
}
2723
]
2824
}

internal/testutil/fixtures/spamfilters/list_success.json

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,8 @@
1919
"filter": [
2020
{
2121
"key": "k8s.namespace.name",
22-
"value": {
23-
"stringValue": {
24-
"operator": "equals",
25-
"comparisonValue": "kube-system"
26-
}
27-
}
22+
"operator": "is",
23+
"value": "kube-system"
2824
}
2925
]
3026
}
@@ -48,12 +44,8 @@
4844
"filter": [
4945
{
5046
"key": "otel.span.name",
51-
"value": {
52-
"stringValue": {
53-
"operator": "starts_with",
54-
"comparisonValue": "debug-"
55-
}
56-
}
47+
"operator": "starts_with",
48+
"value": "debug-"
5749
}
5850
]
5951
}

test/roundtrip/fixtures/spam-filter.yaml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,5 @@ spec:
88
- log
99
filter:
1010
- key: "k8s.namespace.name"
11-
value:
12-
stringValue:
13-
operator: "equals"
14-
comparisonValue: "kube-system"
11+
operator: "is"
12+
value: "kube-system"

0 commit comments

Comments
 (0)