Skip to content

Commit 4b41eba

Browse files
authored
fix: added missing validations (#327)
1 parent 8e97694 commit 4b41eba

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

metadata.display.yaml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ spec:
3030
alternative_location_id:
3131
name: alternative_location_id
3232
title: Alternative Location Id
33+
regexValidation: ^[a-z]+(?:-[a-z0-9]+)*[0-9]-[a-z]$
34+
validation: Must be a lowercase Google Cloud zone (e.g., us-central1-b), different from locationId
3335
auth_enabled:
3436
name: auth_enabled
3537
title: Auth Enabled
@@ -40,6 +42,8 @@ spec:
4042
authorized_network:
4143
name: authorized_network
4244
title: Authorized Network
45+
regexValidation: "^(projects/[a-z][a-z0-9-]{4,28}[a-z0-9]/global/networks/[a-zA-Z0-9-_]+|[a-zA-Z0-9-_]+)$"
46+
validation: Network must be a valid network name or a full resource path.
4347
connect_mode:
4448
name: connect_mode
4549
title: Connect Mode
@@ -55,6 +59,8 @@ spec:
5559
customer_managed_key:
5660
name: customer_managed_key
5761
title: Customer Managed Key
62+
regexValidation: "^projects/[a-z][a-z0-9-]{4,28}[a-z0-9]/locations/[a-z0-9-]+/keyRings/[a-z0-9-_]+/cryptoKeys/[a-z0-9-_]+$"
63+
validation: Must follow the Cloud KMS CryptoKey format like projects/my-project/locations/us-central1/keyRings/my-keyring/cryptoKeys/my-key
5864
display_name:
5965
name: display_name
6066
title: Display Name
@@ -68,10 +74,31 @@ spec:
6874
location_id:
6975
name: location_id
7076
title: Location Id
77+
regexValidation: ^[a-z]+(?:-[a-z0-9]+)*[0-9]-[a-z]$
78+
validation: Must be a lowercase GCP zone like us-central1-b
7179
maintenance_policy:
7280
name: maintenance_policy
7381
title: Maintenance Policy
7482
level: 1
83+
properties:
84+
day:
85+
name: day
86+
title: Day
87+
enumValueLabels:
88+
- label: MONDAY
89+
value: MONDAY
90+
- label: TUESDAY
91+
value: TUESDAY
92+
- label: WEDNESDAY
93+
value: WEDNESDAY
94+
- label: THURSDAY
95+
value: THURSDAY
96+
- label: FRIDAY
97+
value: FRIDAY
98+
- label: SATURDAY
99+
value: SATURDAY
100+
- label: SUNDAY
101+
value: SUNDAY
75102
memory_size_gb:
76103
name: memory_size_gb
77104
title: Memory Size GiB
@@ -93,6 +120,27 @@ spec:
93120
value:
94121
persistence_mode: RDB
95122
rdb_snapshot_period: ONE_HOUR
123+
properties:
124+
persistence_mode:
125+
name: persistence_mode
126+
title: Persistence Mode
127+
enumValueLabels:
128+
- label: RDB
129+
value: RDB
130+
- label: DISABLED
131+
value: DISABLED
132+
rdb_snapshot_period:
133+
name: rdb_snapshot_period
134+
title: RDB Snapshot Period
135+
enumValueLabels:
136+
- label: ONE_HOUR
137+
value: ONE_HOUR
138+
- label: SIX_HOURS
139+
value: SIX_HOURS
140+
- label: TWELVE_HOURS
141+
value: TWELVE_HOURS
142+
- label: TWENTY_FOUR_HOURS
143+
value: TWENTY_FOUR_HOURS
96144
project_id:
97145
name: project_id
98146
title: Project Id
@@ -139,9 +187,13 @@ spec:
139187
reserved_ip_range:
140188
name: reserved_ip_range
141189
title: Reserved Ip Range
190+
regexValidation: "^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9]).){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])/([0-9]|[1-2][0-9]|3[0-2])$"
191+
validation: Must be a valid CIDR range (e.g., 10.0.0.0/29)
142192
secondary_ip_range:
143193
name: secondary_ip_range
144194
title: Secondary Ip Range
195+
regexValidation: "^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9]).){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])/([0-9]|[1-2][0-9]|3[0-2])$"
196+
validation: Must be a valid CIDR range (e.g., 10.0.0.0/29)
145197
tier:
146198
name: tier
147199
title: Tier

0 commit comments

Comments
 (0)