Skip to content

Commit 95a7dde

Browse files
authored
add = character to tag validation regex (#2008)
1 parent c925075 commit 95a7dde

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

pkg/tags/tags.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ const (
6969
// https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html#tag-restrictions
7070
// borrowed from this article and also testing various ASCII characters following regex
7171
// is supported by AWS S3 for both tags and values.
72-
var validTagKeyValue = regexp.MustCompile(`^[a-zA-Z0-9-+\-._:/@ ]+$`)
72+
var validTagKeyValue = regexp.MustCompile(`^[a-zA-Z0-9-+\-._:/@ =]+$`)
7373

7474
func checkKey(key string) error {
7575
if len(key) == 0 {

pkg/tags/tags_test.go

+5
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ func TestParseTags(t *testing.T) {
4343
false,
4444
2,
4545
},
46+
{
47+
"key=value=",
48+
false,
49+
1,
50+
},
4651
{
4752
fmt.Sprintf("%0128d=%0256d", 1, 1),
4853
false,

0 commit comments

Comments
 (0)