prometheus/config
Alexey Shumkin 73ddf603af
discovery/kubernetes: Fix valid label selector causing config error
Label selector can be
"set-based"(https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#set-based-requirement)
but such a selector causes Prometheus start failure with the "unexpected
error: parsing YAML file ...: invalid selector: 'foo in (bar,baz)';
can't understand 'baz)'"-like error.

This is caused by the `fields.ParseSelector(string)` function that
simply splits an expression as a CSV-list, so a comma confuses such a
parsing method and lead to the error.

Use `labels.Parse(string)` to use a valid lexer to parse a selector
expression.

Closes #8284.

Signed-off-by: Alexey Shumkin <Alex.Crezoff@gmail.com>
2020-12-16 10:56:01 +03:00
..
testdata discovery/kubernetes: Fix valid label selector causing config error 2020-12-16 10:56:01 +03:00
config_default_test.go Invert service discovery dependencies (#7701) 2020-08-20 13:48:26 +01:00
config_test.go Allow metric metadata to be propagated via Remote Write. (#6815) 2020-11-19 20:53:03 +05:30
config_windows_test.go Invert service discovery dependencies (#7701) 2020-08-20 13:48:26 +01:00
config.go Allow metric metadata to be propagated via Remote Write. (#6815) 2020-11-19 20:53:03 +05:30