Skip to content
This repository has been archived by the owner on Mar 4, 2024. It is now read-only.

EVEREST-271 fix name starts with a digit #154

Merged
merged 1 commit into from
Sep 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion api/validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func validateRFC1123(s, name string) error {
return ErrNameTooLong(name)
}

rfc1123Regex := "^[a-z0-9]([-a-z0-9]{0,61}[a-z0-9])?$"
rfc1123Regex := "^[a-z]([-a-z0-9]{0,61}[a-z0-9])?$"
re := regexp.MustCompile(rfc1123Regex)
if !re.MatchString(s) {
return ErrNameNotRFC1123Compatible(name)
Expand Down
6 changes: 5 additions & 1 deletion api/validation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,11 @@ func TestValidateRFC1123(t *testing.T) {
valid: false,
},
{
value: "1abc-sAAf12",
value: "abc-sAAf12",
valid: false,
},
{
value: "1abc-sf12",
valid: false,
},
{
Expand Down
Loading