Skip to content

Commit 405389b

Browse files
authored
Merge pull request #3702 from Jacobious52/main
fix validation for aws tags with spaces
2 parents 06da7fc + 4b69599 commit 405389b

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

api/v1beta1/tags.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ func (t Tags) Validate() []*field.Error {
8686
const maxUserTagsAllowed = 50
8787
var errs field.ErrorList
8888
var userTagCount = len(t)
89-
re := regexp.MustCompile(`^[a-zA-Z0-9\\s\_\.\:\=\+\-\@\/]*$`)
89+
re := regexp.MustCompile(`^[a-zA-Z0-9\s\_\.\:\=\+\-\@\/]*$`)
9090

9191
for k, v := range t {
9292
if len(k) < 1 {

api/v1beta1/tags_test.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,13 @@ func TestTags_Validate(t *testing.T) {
179179
},
180180
expected: nil,
181181
},
182+
{
183+
name: "no errors - spaces allowed",
184+
self: Tags{
185+
"validKey": "valid Value",
186+
},
187+
expected: nil,
188+
},
182189
{
183190
name: "key cannot be empty",
184191
self: Tags{

0 commit comments

Comments
 (0)