-
Notifications
You must be signed in to change notification settings - Fork 56
Closed
Description
Summary
The current documentation for slice name validation in the slice definitions reference is inaccurate compared to the actual regex validation in the code.
Current Documentation
"The slice names must consist only of lower case letters(a-z), digits(0-9) and minus (-) signs. They must be at least three characters long and must start with an alphanumeric character."
Actual Regex
var SnameExp = regexp.MustCompile(`^([a-z](?:-?[a-z0-9]){2,})$`)Issues
- "start with an alphanumeric character" - The regex requires starting with
[a-z](lowercase letter only), not alphanumeric - "consist only of lower case letters(a-z), digits(0-9) and minus (-) signs" - This is imprecise. Hyphens can only appear when followed by a letter or digit, not anywhere
Suggested Fix
Update the documentation to reflect the regex pattern accurately:
"Slice names must start with a lowercase letter, be at least 3 characters long, and each subsequent character must be either a lowercase letter/digit or a hyphen followed by a lowercase letter/digit."
Context
This came up during work on issue #158 in the PR #240 where we improved the error message for invalid slice names.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels