Skip to content

Commit c309956

Browse files
committed
Assert that newlines in coma separated arguments are ignored
This test is added to ensure that ksm can be invoked as follows and that this is a "documented" feature. ``` <ksm> --metric-denylist=" ^kube_.+_created$, ^kube_.+_metadata_resource_version$, ^kube_pod_completion_time$, ^kube_pod_status_scheduled$ " ``` See: Usage in kube-prometheus jsonnet for example [1] [1]: https://github.com/prometheus-operator/kube-prometheus/blob/9cf6111562f52107ae2b0b626db54f19b7e7d486/jsonnet/kube-prometheus/addons/ksm-lite.libsonnet#L18 Signed-off-by: Sunil Thaha <[email protected]>
1 parent c766f5c commit c309956

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

pkg/options/types_test.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,14 @@ func TestMetricSetSet(t *testing.T) {
106106
"kube_daemonset_labels": {},
107107
}),
108108
},
109+
{
110+
Desc: "newlines are ignored",
111+
Value: "\n^kube_.+_annotations$,\n ^kube_secret_labels$\n",
112+
Wanted: MetricSet{
113+
"^kube_secret_labels$": struct{}{},
114+
"^kube_.+_annotations$": struct{}{},
115+
},
116+
},
109117
}
110118

111119
for _, test := range tests {

0 commit comments

Comments
 (0)