Skip to content

Commit 3393dae

Browse files
authored
fix: added missing validations (#528)
1 parent 361d279 commit 3393dae

File tree

2 files changed

+331
-1
lines changed

2 files changed

+331
-1
lines changed

modules/instance_template/metadata.display.yaml

Lines changed: 195 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,17 @@ spec:
3131
access_config:
3232
name: access_config
3333
title: Access Config
34+
properties:
35+
network_tier:
36+
name: network_tier
37+
title: Network Tier
38+
enumValueLabels:
39+
- label: PREMIUM
40+
value: PREMIUM
41+
- label: STANDARD
42+
value: STANDARD
43+
- label: FIXED_STANDARD
44+
value: FIXED_STANDARD
3445
altDefaults:
3546
- type: ALTERNATE_TYPE_DC
3647
value:
@@ -39,25 +50,141 @@ spec:
3950
additional_disks:
4051
name: additional_disks
4152
title: Additional Disks
53+
properties:
54+
disk_type:
55+
name: disk_type
56+
title: Disk Type
57+
enumValueLabels:
58+
- label: pd-standard
59+
value: pd-standard
60+
- label: pd-balanced
61+
value: pd-balanced
62+
- label: pd-ssd
63+
value: pd-ssd
64+
- label: local-ssd
65+
value: local-ssd
66+
- label: hyperdisk-balanced
67+
value: hyperdisk-balanced
68+
- label: hyperdisk-throughput
69+
value: hyperdisk-throughput
70+
- label: hyperdisk-extreme
71+
value: hyperdisk-extreme
72+
interface:
73+
name: interface
74+
title: Interface
75+
enumValueLabels:
76+
- label: SCSI
77+
value: SCSI
78+
- label: NVME
79+
value: NVME
80+
mode:
81+
name: mode
82+
title: Mode
83+
enumValueLabels:
84+
- label: READ_WRITE
85+
value: READ_WRITE
86+
- label: READ_ONLY
87+
value: READ_ONLY
4288
additional_networks:
4389
name: additional_networks
4490
title: Additional Networks
91+
properties:
92+
network:
93+
name: network
94+
title: Network
95+
regexValidation: "^(?:[a-z0-9-]{1,63}|projects/[a-z0-9-]+/global/networks/[a-z0-9-]{1,63})$"
96+
validation: Invalid network format. Must be a network name or a self link.
97+
subnetwork:
98+
name: subnetwork
99+
title: Subnetwork
100+
regexValidation: "^(?:[a-z0-9-]{1,63}|(?:projects/[a-z0-9-]+/)?(?:regions/[a-z0-9-]+/)?subnetworks/[a-z0-9-]{1,63})$"
101+
validation: Invalid subnetwork format. Must be a subnetwork name or a self link.
102+
network_ip:
103+
name: network_ip
104+
title: Network Ip
105+
regexValidation: "^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?).){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$"
106+
validation: Invalid IP address format. Must be a valid IPv4 address.
107+
nic_type:
108+
name: nic_type
109+
title: Nic Type
110+
enumValueLabels:
111+
- label: VIRTIO_NET
112+
value: VIRTIO_NET
113+
- label: GVNIC
114+
value: GVNIC
115+
- label: MRDMA
116+
value: MRDMA
117+
- label: IRDMA
118+
value: IRDMA
119+
stack_type:
120+
name: stack_type
121+
title: Stack Type
122+
enumValueLabels:
123+
- label: IPV4_ONLY
124+
value: IPV4_ONLY
125+
- label: IPV6_ONLY
126+
value: IPV6_ONLY
127+
- label: IPV4_IPV6
128+
value: IPV4_IPV6
129+
access_config:
130+
name: access_config
131+
title: Access Config
132+
properties:
133+
network_tier:
134+
name: network_tier
135+
title: Network Tier
136+
enumValueLabels:
137+
- label: PREMIUM
138+
value: PREMIUM
139+
- label: STANDARD
140+
value: STANDARD
141+
- label: FIXED_STANDARD
142+
value: FIXED_STANDARD
143+
ipv6_access_config:
144+
name: ipv6_access_config
145+
title: Ipv6 Access Config
146+
properties:
147+
network_tier:
148+
name: network_tier
149+
title: Network Tier
150+
enumValueLabels:
151+
- label: PREMIUM
152+
value: PREMIUM
153+
- label: STANDARD
154+
value: STANDARD
45155
alias_ip_range:
46156
name: alias_ip_range
47157
title: Alias Ip Range
48158
auto_delete:
49159
name: auto_delete
50160
title: Auto Delete
161+
enumValueLabels:
162+
- label: "true"
163+
value: "true"
164+
- label: "false"
165+
value: "false"
51166
automatic_restart:
52167
name: automatic_restart
53168
title: Automatic Restart
54169
level: 1
55170
can_ip_forward:
56171
name: can_ip_forward
57172
title: Can Ip Forward
173+
enumValueLabels:
174+
- label: "false"
175+
value: "false"
176+
- label: "true"
177+
value: "true"
58178
confidential_instance_type:
59179
name: confidential_instance_type
60180
title: Confidential Instance Type
181+
enumValueLabels:
182+
- label: SEV
183+
value: SEV
184+
- label: SEV_SNP
185+
value: SEV_SNP
186+
- label: TDX
187+
value: TDX
61188
create_service_account:
62189
name: create_service_account
63190
title: Create Service Account
@@ -83,6 +210,21 @@ spec:
83210
name: disk_type
84211
title: Disk Type
85212
level: 1
213+
enumValueLabels:
214+
- label: pd-standard
215+
value: pd-standard
216+
- label: pd-balanced
217+
value: pd-balanced
218+
- label: pd-ssd
219+
value: pd-ssd
220+
- label: local-ssd
221+
value: local-ssd
222+
- label: hyperdisk-balanced
223+
value: hyperdisk-balanced
224+
- label: hyperdisk-throughput
225+
value: hyperdisk-throughput
226+
- label: hyperdisk-extreme
227+
value: hyperdisk-extreme
86228
enable_confidential_vm:
87229
name: enable_confidential_vm
88230
title: Enable Confidential Vm
@@ -102,6 +244,15 @@ spec:
102244
ipv6_access_config:
103245
name: ipv6_access_config
104246
title: Ipv6 Access Config
247+
properties:
248+
network_tier:
249+
name: network_tier
250+
title: Network Tier
251+
enumValueLabels:
252+
- label: PREMIUM
253+
value: PREMIUM
254+
- label: STANDARD
255+
value: STANDARD
105256
labels:
106257
name: labels
107258
title: Labels
@@ -133,21 +284,44 @@ spec:
133284
name: network
134285
title: Network
135286
level: 1
287+
regexValidation: "^(?:[a-z0-9-]{1,63}|projects/[a-z0-9-]+/global/networks/[a-z0-9-]{1,63})$"
288+
validation: Invalid network format. Must be a network name or a self link.
136289
altDefaults:
137290
- type: ALTERNATE_TYPE_DC
138291
value: default
139292
network_ip:
140293
name: network_ip
141294
title: Network Ip
295+
regexValidation: "^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?).){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$"
296+
validation: Invalid IP address format. Must be a valid IPv4 address.
142297
nic_type:
143298
name: nic_type
144299
title: Nic Type
300+
enumValueLabels:
301+
- label: VIRTIO_NET
302+
value: VIRTIO_NET
303+
- label: GVNIC
304+
value: GVNIC
305+
- label: MRDMA
306+
value: MRDMA
307+
- label: IRDMA
308+
value: IRDMA
145309
on_host_maintenance:
146310
name: on_host_maintenance
147311
title: On Host Maintenance
312+
enumValueLabels:
313+
- label: MIGRATE
314+
value: MIGRATE
315+
- label: TERMINATE
316+
value: TERMINATE
148317
preemptible:
149318
name: preemptible
150319
title: Preemptible
320+
enumValueLabels:
321+
- label: "true"
322+
value: "true"
323+
- label: "false"
324+
value: "false"
151325
project_id:
152326
name: project_id
153327
title: Project Id
@@ -168,6 +342,8 @@ spec:
168342
service_account_project_roles:
169343
name: service_account_project_roles
170344
title: Service Account Project Roles
345+
regexValidation: "^(roles/[a-zA-Z0-9_.]+|(projects/[a-z][a-z0-9-]{4,28}[a-z0-9]|organizations/[0-9]+)/roles/[a-zA-Z0-9_]+)$"
346+
validation: Role must be a valid Google Cloud IAM role name, in the format of 'roles/{role_name}'.
171347
shielded_instance_config:
172348
name: shielded_instance_config
173349
title: Shielded Instance Config
@@ -189,16 +365,30 @@ spec:
189365
spot_instance_termination_action:
190366
name: spot_instance_termination_action
191367
title: Spot Instance Termination Action
368+
enumValueLabels:
369+
- label: STOP
370+
value: STOP
371+
- label: DELETE
372+
value: DELETE
192373
stack_type:
193374
name: stack_type
194375
title: Stack Type
376+
enumValueLabels:
377+
- label: IPV4_ONLY
378+
value: IPV4_ONLY
379+
- label: IPV4_IPV6
380+
value: IPV4_IPV6
381+
- label: IPV6_ONLY
382+
value: IPV6_ONLY
195383
startup_script:
196384
name: startup_script
197385
title: Startup Script
198386
subnetwork:
199387
name: subnetwork
200388
title: Subnetwork
201389
level: 1
390+
regexValidation: "^(?:[a-z0-9-]{1,63}|(?:projects/[a-z0-9-]+/)?(?:regions/[a-z0-9-]+/)?subnetworks/[a-z0-9-]{1,63})$"
391+
validation: Invalid subnetwork format. Must be a subnetwork name or a self link.
202392
subnetwork_project:
203393
name: subnetwork_project
204394
title: Subnetwork Project
@@ -212,3 +402,8 @@ spec:
212402
total_egress_bandwidth_tier:
213403
name: total_egress_bandwidth_tier
214404
title: Total Egress Bandwidth Tier
405+
enumValueLabels:
406+
- label: DEFAULT
407+
value: DEFAULT
408+
- label: TIER_1
409+
value: TIER_1

0 commit comments

Comments
 (0)