kcp icon indicating copy to clipboard operation
kcp copied to clipboard

bug: confusing error message about workspace name

Open MikeSpreitzer opened this issue 2 years ago • 2 comments

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 .

MikeSpreitzer avatar Jan 27 '23 02:01 MikeSpreitzer

Corollary nit: should not be capitalizing Workspace.tenancy...

stevekuznetsov avatar Jan 27 '23 13:01 stevekuznetsov

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

kcp-ci-bot avatar Apr 15 '24 20:04 kcp-ci-bot

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

kcp-ci-bot avatar May 15 '24 20:05 kcp-ci-bot

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 avatar Jun 14 '24 20:06 kcp-ci-bot

@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.

kcp-ci-bot avatar Jun 14 '24 20:06 kcp-ci-bot