Describe the bug
kjournal audit --field-selector user.username=system:s -v10
I1118 08:26:22.639012 442558 request.go:1154] Response Body: {"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"unable to parse requirement: values[0][user.username]: Invalid value: \"system:s\": a valid label must be an empty string or consist of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character (e.g. 'MyValue', or 'my_value', or '12345', regex used for validation is '(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?')","reason":"BadRequest","code":400}
Currently label filters get used behind the scenes. The problem is the values are quite restrictive.
The reason why label and not field selector are used is because of the operators. Label selectors also support >, <.
Expected behavior
The field selector gets parsed and used without an error if it contains special characters.
Environment
- kjournal-apiserver version: v0.0.10
- kjournal-cli version: v0.0.10
- kubernetes version: [e.g. v1.24.0]
- Elasticsearch version: [e.g. v8.0.0]
Additional context
Describe the bug
kjournal audit --field-selector user.username=system:s -v10I1118 08:26:22.639012 442558 request.go:1154] Response Body: {"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"unable to parse requirement: values[0][user.username]: Invalid value: \"system:s\": a valid label must be an empty string or consist of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character (e.g. 'MyValue', or 'my_value', or '12345', regex used for validation is '(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?')","reason":"BadRequest","code":400}Currently label filters get used behind the scenes. The problem is the values are quite restrictive.
The reason why label and not field selector are used is because of the operators. Label selectors also support >, <.
Expected behavior
The field selector gets parsed and used without an error if it contains special characters.
Environment
Additional context