kcp
kcp copied to clipboard
bug: confusing error message about workspace name
Describe the bug
I tried creating a workspace with a funky name and it failed with a compound error message that: (a) makes an incorrect English statement of what is allowed, and (b) contains two different regular expressions describing what is allowed (these two regexes match different sets of strings).
(base) mspreitz@mjs12 kcp % kubectl ws create ab-.-cd-.-ef
Error: Workspace.tenancy.kcp.io "ab-.-cd-.-ef" is invalid: [metadata.name: Invalid value: "ab-.-cd-.-ef": a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*'), metadata.name: Invalid value: "ab-.-cd-.-ef": metadata.name in body should match '^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$']
Then I tried creating a workspace with a different funky name, and it failed with a shorter error message that only asserted one regex.
(base) mspreitz@mjs12 kcp % kubectl ws create ab-w.w-cd-w.w-ef
Error: Workspace.tenancy.kcp.io "ab-w.w-cd-w.w-ef" is invalid: metadata.name: Invalid value: "ab-w.w-cd-w.w-ef": metadata.name in body should match '^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$'
Steps To Reproduce
Shown above.
Expected Behaviour
Consistency.
Additional Context
This was using commit 4506fdc0 .
Corollary nit: should not be capitalizing Workspace.tenancy...
Issues go stale after 90d of inactivity.
After a furter 30 days, they will turn rotten.
Mark the issue as fresh with /remove-lifecycle stale
.
If this issue is safe to close now please do so with /close
.
/lifecycle stale
Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten
.
Rotten issues close after an additional 30d of inactivity.
If this issue is safe to close now please do so with /close
.
/lifecycle rotten
Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen
.
Mark the issue as fresh with /remove-lifecycle rotten
.
/close
@kcp-ci-bot: Closing this issue.
In response to this:
Rotten issues close after 30d of inactivity. Reopen the issue with
/reopen
. Mark the issue as fresh with/remove-lifecycle rotten
./close
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.