Skip to content

Commit 1cdfad8

Browse files
author
Enda
authored
fix(serviceaccount): allow capital letters in description (#550)
1 parent 18eaa0b commit 1cdfad8

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

cmd/rhoas/pkged.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

locales/cmd/serviceaccount/active.en.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ one = 'service account name cannot exceed {{.MaxNameLen}} characters'
8181
one = 'invalid service account name "{{.Name}}"; only lowercase letters (a-z), numbers, and "-" are accepted'
8282

8383
[serviceAccount.common.validation.description.error.invalidChars]
84-
one = 'invalid service account description "{{.Description}}"; only lowercase letters (a-z) and numbers are accepted'
84+
one = 'invalid service account description "{{.Description}}"; only alphanumeric characters are accepted'
8585

8686
[serviceAccount.common.validation.description.error.lengthError]
8787
one = 'service account description cannot exceed {{.MaxNameLen}} characters'

pkg/serviceaccount/validation/validation.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const (
1313
maxNameLength = 50
1414
minNameLength = 1
1515
// description validation rules
16-
legalDescriptionChars = "^[a-z0-9\\s]*$"
16+
legalDescriptionChars = "^[a-zA-Z0-9\\s]*$"
1717
maxDescriptionLength = 255
1818
)
1919

pkg/serviceaccount/validation/validation_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,9 @@ func TestValidateDescription(t *testing.T) {
110110
wantErr: true,
111111
},
112112
{
113-
name: "fails with capital letters",
113+
name: "passes with capital letters",
114114
args: args{"Hello"},
115-
wantErr: true,
115+
wantErr: false,
116116
},
117117
}
118118
for _, tt := range tests {

0 commit comments

Comments
 (0)