prometheus/discovery/kubernetes
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
..
client_metrics.go update kubernetes to v1.18.x and update ingress apiVersion 2020-06-01 08:26:50 -07:00
endpoints.go discovery/kubernetes: remove extraneous parameters from send() 2020-02-18 17:36:57 +01:00
endpoints_test.go update kubernetes to v1.18.x and update ingress apiVersion 2020-06-01 08:26:50 -07:00
endpointslice.go discovery/kubernetes: Add Kubernetes EndpointSlice discovery 2020-06-14 21:55:27 +02:00
endpointslice_test.go Move away from testutil, refactor imports (#8087) 2020-10-22 11:00:08 +02:00
ingress.go update kubernetes to v1.18.x and update ingress apiVersion 2020-06-01 08:26:50 -07:00
ingress_test.go update kubernetes to v1.18.x and update ingress apiVersion 2020-06-01 08:26:50 -07:00
kubernetes.go discovery/kubernetes: Fix valid label selector causing config error 2020-12-16 10:56:01 +03:00
kubernetes_test.go Testify: move to require (#8122) 2020-10-29 09:43:23 +00:00
node.go discovery/kubernetes: remove extraneous parameters from send() 2020-02-18 17:36:57 +01:00
node_test.go update kubernetes to v1.18.x and update ingress apiVersion 2020-06-01 08:26:50 -07:00
pod.go discovery/kubernetes: remove extraneous parameters from send() 2020-02-18 17:36:57 +01:00
pod_test.go update kubernetes to v1.18.x and update ingress apiVersion 2020-06-01 08:26:50 -07:00
service.go add service type metadata to kubernetes_sd_config service role #6496 (#6684) 2020-02-25 09:22:14 +01:00
service_test.go update kubernetes to v1.18.x and update ingress apiVersion 2020-06-01 08:26:50 -07:00