Skip to content

Commit

Permalink
remove checking of regex on tags
Browse files Browse the repository at this point in the history
  • Loading branch information
ElijahQuinones committed Aug 5, 2024
1 parent 5cfe20f commit bfebb68
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions pkg/driver/validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ package driver
import (
"errors"
"fmt"
"regexp"
"strings"

"github.com/kubernetes-sigs/aws-ebs-csi-driver/pkg/cloud"
Expand All @@ -42,11 +41,6 @@ func ValidateDriverOptions(options *Options) error {
return nil
}

var (
/// https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html
awsTagValidRegex = regexp.MustCompile(`[a-zA-Z0-9_.:=+\-@]*`)
)

func validateExtraTags(tags map[string]string, warnOnly bool) error {
if len(tags) > cloud.MaxNumTagsPerResource {
return fmt.Errorf("Too many tags (actual: %d, limit: %d)", len(tags), cloud.MaxNumTagsPerResource)
Expand Down Expand Up @@ -76,13 +70,6 @@ func validateExtraTags(tags map[string]string, warnOnly bool) error {
if strings.HasPrefix(k, cloud.AWSTagKeyPrefix) {
return fmt.Errorf("Tag key prefix '%s' is reserved", cloud.AWSTagKeyPrefix)
}
//TODO possibly remove these lines below as failure condition is impossible to encounter
if !awsTagValidRegex.MatchString(k) {
return fmt.Errorf("Tag key '%s' is not a valid AWS tag key", k)
}
if !awsTagValidRegex.MatchString(v) {
return fmt.Errorf("Tag value '%s' is not a valid AWS tag value", v)
}
return nil
}

Expand Down

0 comments on commit bfebb68

Please sign in to comment.