Skip to content
This repository was archived by the owner on Aug 12, 2025. It is now read-only.
This repository was archived by the owner on Aug 12, 2025. It is now read-only.

Field selectors can not be parsed containing special chars #36

@raffis

Description

@raffis

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions