Skip to content

Namespace name: a middle part that starts or ends with '-' is accepted (abc--x-dev) #512

Closed

Description

@ephico2real2

Parent: #479. Found by Fable in the review of PR #511, 2026-11-20. It predates #511.

What happens. A desired middle that starts or ends with a dash is accepted everywhere: the API, the Kyverno rule, the stand-in and the portal. So abc--x-dev (middle -x) and abc---dev (middle -) pass. They are valid Kubernetes names (DNS-1123 allows inner hyphens), but they make the name ambiguous and break the rule that the middle sits between two single hyphens.

Fix to make. The middle starts and ends with a letter or digit (^[a-z0-9]([-a-z0-9]*[a-z0-9])?$), in the API (_check_desired_name), the generated Kyverno rule, the stand-in and the portal hint, with a test per layer: abc--x-dev refused, abc-x-y-dev accepted.

Activity

  1. added
    bug
    sev:low
    In-Progress
    on Nov 21, 2026
  2. added a commit that references this issue on Nov 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    In-Progressbugsev:low

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions