diff --git a/pkg/driver/validation.go b/pkg/driver/validation.go index 3cc1c5837f..456cbc2dd5 100644 --- a/pkg/driver/validation.go +++ b/pkg/driver/validation.go @@ -19,7 +19,6 @@ package driver import ( "errors" "fmt" - "regexp" "strings" "github.com/kubernetes-sigs/aws-ebs-csi-driver/pkg/cloud" @@ -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) @@ -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 }