Skip to content

Commit 4c45dc3

Browse files
committed
OCPBUGS-44199: Allow spaces in AWS tags
An incorrect regex validation prevents users from specifying AWS tag keys or values that include spaces, which are allowed by AWS's official regex: https://docs.aws.amazon.com/directoryservice/latest/devguide/API_Tag.html
1 parent 1a7b90f commit 4c45dc3

File tree

38 files changed

+76
-76
lines changed

38 files changed

+76
-76
lines changed

config/v1/types_infrastructure.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -531,15 +531,15 @@ type AWSResourceTag struct {
531531
// key is the key of the tag
532532
// +kubebuilder:validation:MinLength=1
533533
// +kubebuilder:validation:MaxLength=128
534-
// +kubebuilder:validation:Pattern=`^[0-9A-Za-z_.:/=+-@]+$`
534+
// +kubebuilder:validation:Pattern=`^([\p{L}\p{Z}\p{N}_.:/=+\-@]*)$`
535535
// +required
536536
Key string `json:"key"`
537537
// value is the value of the tag.
538538
// Some AWS service do not support empty values. Since tags are added to resources in many services, the
539539
// length of the tag value must meet the requirements of all services.
540540
// +kubebuilder:validation:MinLength=1
541541
// +kubebuilder:validation:MaxLength=256
542-
// +kubebuilder:validation:Pattern=`^[0-9A-Za-z_.:/=+-@]+$`
542+
// +kubebuilder:validation:Pattern=`^([\p{L}\p{Z}\p{N}_.:/=+\-@]*)$`
543543
// +required
544544
Value string `json:"value"`
545545
}

config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_infrastructures-CustomNoUpgrade.crd.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1308,7 +1308,7 @@ spec:
13081308
description: key is the key of the tag
13091309
maxLength: 128
13101310
minLength: 1
1311-
pattern: ^[0-9A-Za-z_.:/=+-@]+$
1311+
pattern: ^([\p{L}\p{Z}\p{N}_.:/=+\-@]*)$
13121312
type: string
13131313
value:
13141314
description: |-
@@ -1317,7 +1317,7 @@ spec:
13171317
length of the tag value must meet the requirements of all services.
13181318
maxLength: 256
13191319
minLength: 1
1320-
pattern: ^[0-9A-Za-z_.:/=+-@]+$
1320+
pattern: ^([\p{L}\p{Z}\p{N}_.:/=+\-@]*)$
13211321
type: string
13221322
required:
13231323
- key

config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_infrastructures-Default.crd.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1188,7 +1188,7 @@ spec:
11881188
description: key is the key of the tag
11891189
maxLength: 128
11901190
minLength: 1
1191-
pattern: ^[0-9A-Za-z_.:/=+-@]+$
1191+
pattern: ^([\p{L}\p{Z}\p{N}_.:/=+\-@]*)$
11921192
type: string
11931193
value:
11941194
description: |-
@@ -1197,7 +1197,7 @@ spec:
11971197
length of the tag value must meet the requirements of all services.
11981198
maxLength: 256
11991199
minLength: 1
1200-
pattern: ^[0-9A-Za-z_.:/=+-@]+$
1200+
pattern: ^([\p{L}\p{Z}\p{N}_.:/=+\-@]*)$
12011201
type: string
12021202
required:
12031203
- key

config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_infrastructures-DevPreviewNoUpgrade.crd.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1308,7 +1308,7 @@ spec:
13081308
description: key is the key of the tag
13091309
maxLength: 128
13101310
minLength: 1
1311-
pattern: ^[0-9A-Za-z_.:/=+-@]+$
1311+
pattern: ^([\p{L}\p{Z}\p{N}_.:/=+\-@]*)$
13121312
type: string
13131313
value:
13141314
description: |-
@@ -1317,7 +1317,7 @@ spec:
13171317
length of the tag value must meet the requirements of all services.
13181318
maxLength: 256
13191319
minLength: 1
1320-
pattern: ^[0-9A-Za-z_.:/=+-@]+$
1320+
pattern: ^([\p{L}\p{Z}\p{N}_.:/=+\-@]*)$
13211321
type: string
13221322
required:
13231323
- key

config/v1/zz_generated.crd-manifests/0000_10_config-operator_01_infrastructures-TechPreviewNoUpgrade.crd.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1308,7 +1308,7 @@ spec:
13081308
description: key is the key of the tag
13091309
maxLength: 128
13101310
minLength: 1
1311-
pattern: ^[0-9A-Za-z_.:/=+-@]+$
1311+
pattern: ^([\p{L}\p{Z}\p{N}_.:/=+\-@]*)$
13121312
type: string
13131313
value:
13141314
description: |-
@@ -1317,7 +1317,7 @@ spec:
13171317
length of the tag value must meet the requirements of all services.
13181318
maxLength: 256
13191319
minLength: 1
1320-
pattern: ^[0-9A-Za-z_.:/=+-@]+$
1320+
pattern: ^([\p{L}\p{Z}\p{N}_.:/=+\-@]*)$
13211321
type: string
13221322
required:
13231323
- key

config/v1/zz_generated.featuregated-crd-manifests/infrastructures.config.openshift.io/AAA_ungated.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1161,7 +1161,7 @@ spec:
11611161
description: key is the key of the tag
11621162
maxLength: 128
11631163
minLength: 1
1164-
pattern: ^[0-9A-Za-z_.:/=+-@]+$
1164+
pattern: ^([\p{L}\p{Z}\p{N}_.:/=+\-@]*)$
11651165
type: string
11661166
value:
11671167
description: |-
@@ -1170,7 +1170,7 @@ spec:
11701170
length of the tag value must meet the requirements of all services.
11711171
maxLength: 256
11721172
minLength: 1
1173-
pattern: ^[0-9A-Za-z_.:/=+-@]+$
1173+
pattern: ^([\p{L}\p{Z}\p{N}_.:/=+\-@]*)$
11741174
type: string
11751175
required:
11761176
- key

config/v1/zz_generated.featuregated-crd-manifests/infrastructures.config.openshift.io/AWSClusterHostedDNS.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1258,7 +1258,7 @@ spec:
12581258
description: key is the key of the tag
12591259
maxLength: 128
12601260
minLength: 1
1261-
pattern: ^[0-9A-Za-z_.:/=+-@]+$
1261+
pattern: ^([\p{L}\p{Z}\p{N}_.:/=+\-@]*)$
12621262
type: string
12631263
value:
12641264
description: |-
@@ -1267,7 +1267,7 @@ spec:
12671267
length of the tag value must meet the requirements of all services.
12681268
maxLength: 256
12691269
minLength: 1
1270-
pattern: ^[0-9A-Za-z_.:/=+-@]+$
1270+
pattern: ^([\p{L}\p{Z}\p{N}_.:/=+\-@]*)$
12711271
type: string
12721272
required:
12731273
- key

config/v1/zz_generated.featuregated-crd-manifests/infrastructures.config.openshift.io/BareMetalLoadBalancer.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1154,7 +1154,7 @@ spec:
11541154
description: key is the key of the tag
11551155
maxLength: 128
11561156
minLength: 1
1157-
pattern: ^[0-9A-Za-z_.:/=+-@]+$
1157+
pattern: ^([\p{L}\p{Z}\p{N}_.:/=+\-@]*)$
11581158
type: string
11591159
value:
11601160
description: |-
@@ -1163,7 +1163,7 @@ spec:
11631163
length of the tag value must meet the requirements of all services.
11641164
maxLength: 256
11651165
minLength: 1
1166-
pattern: ^[0-9A-Za-z_.:/=+-@]+$
1166+
pattern: ^([\p{L}\p{Z}\p{N}_.:/=+\-@]*)$
11671167
type: string
11681168
required:
11691169
- key

config/v1/zz_generated.featuregated-crd-manifests/infrastructures.config.openshift.io/GCPClusterHostedDNS.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1154,7 +1154,7 @@ spec:
11541154
description: key is the key of the tag
11551155
maxLength: 128
11561156
minLength: 1
1157-
pattern: ^[0-9A-Za-z_.:/=+-@]+$
1157+
pattern: ^([\p{L}\p{Z}\p{N}_.:/=+\-@]*)$
11581158
type: string
11591159
value:
11601160
description: |-
@@ -1163,7 +1163,7 @@ spec:
11631163
length of the tag value must meet the requirements of all services.
11641164
maxLength: 256
11651165
minLength: 1
1166-
pattern: ^[0-9A-Za-z_.:/=+-@]+$
1166+
pattern: ^([\p{L}\p{Z}\p{N}_.:/=+\-@]*)$
11671167
type: string
11681168
required:
11691169
- key

config/v1/zz_generated.featuregated-crd-manifests/infrastructures.config.openshift.io/GCPLabelsTags.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1154,7 +1154,7 @@ spec:
11541154
description: key is the key of the tag
11551155
maxLength: 128
11561156
minLength: 1
1157-
pattern: ^[0-9A-Za-z_.:/=+-@]+$
1157+
pattern: ^([\p{L}\p{Z}\p{N}_.:/=+\-@]*)$
11581158
type: string
11591159
value:
11601160
description: |-
@@ -1163,7 +1163,7 @@ spec:
11631163
length of the tag value must meet the requirements of all services.
11641164
maxLength: 256
11651165
minLength: 1
1166-
pattern: ^[0-9A-Za-z_.:/=+-@]+$
1166+
pattern: ^([\p{L}\p{Z}\p{N}_.:/=+\-@]*)$
11671167
type: string
11681168
required:
11691169
- key

0 commit comments

Comments
 (0)