8000 Labels specified in the Gatway Infrastructure (i.e., `.spec.infrastructure.labels`) might be invalid · Issue #3197 · kubernetes-sigs/gateway-api · GitHub
[go: up one dir, main page]

Skip to content

Labels specified in the Gatway Infrastructure (i.e., .spec.infrastructure.labels) might be invalid #3197

@snorwin

Description

@snorwin

This enhancement request is related 6990 to GEP: In Cluster Gateway Deployments (#1762)

What would you like to be added:
Along with AnnotationValue (which was introduced in #886), a new type alias called LabelValue should be introduced. Label values follow a well-defined format that can be validated using a pattern:

Valid label value:

  • must be 63 characters or less (can be empty),
  • unless empty, must begin and end with an alphanumeric character ([a-z0-9A-Z]),
  • could contain dashes (-), underscores (_), dots (.), and alphanumerics between.

Reference: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/

Why this is needed:
If users can specify invalid label values in the Gateway resource, it may cause issues in the controllers if the values are not validated. The validation in the API schema eliminates the need for each controller to implement its own validation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/featureCategorizes issue or PR as related to a new feature.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0