Skip to content

Commit 96749e4

Browse files
committed
regex validation for network,subnetwork ,workloadpool and cidr block
1 parent c4869a4 commit 96749e4

File tree

2 files changed

+52
-0
lines changed

2 files changed

+52
-0
lines changed

modules/gke-autopilot-cluster/metadata.display.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,16 @@ spec:
256256
master_authorized_networks_config:
257257
name: master_authorized_networks_config
258258
title: Master Authorized Networks Config
259+
properties:
260+
cidr_blocks:
261+
name: cidr_blocks
262+
title: Cidr Blocks
263+
properties:
264+
cidr_block:
265+
name: cidr_block
266+
title: Cidr Block
267+
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]?)\/(3[0-2]|[12]?[0-9]))|((s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*\/(12[0-8]|1[01][0-9]|[1-9]?[0-9]))))$
268+
validation: Enter the valid [Cidr notation](https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing#CIDR_notation)
259269
mesh_certificates:
260270
name: mesh_certificates
261271
title: Mesh Certificates
@@ -306,6 +316,11 @@ spec:
306316
network:
307317
name: network
308318
title: Network
319+
regexValidation: ^[a-z][a-z0-9-]{0,60}[a-z0-9]$
320+
validation: Network name must start with a lowercase letter followed by up to 62 lowercase letters, numbers, or hyphens and cannot end with a hyphen.
321+
altDefaults:
322+
- type: ALTERNATE_TYPE_DC
323+
value: default
309324
node_locations:
310325
name: node_locations
311326
title: Node Locations
@@ -456,6 +471,11 @@ spec:
456471
subnetwork:
457472
name: subnetwork
458473
title: Subnetwork
474+
regexValidation: ^[a-z][a-z0-9-]{0,60}[a-z0-9]$
475+
validation: Network name must start with a lowercase letter followed by up to 62 lowercase letters, numbers, or hyphens and cannot end with a hyphen.
476+
altDefaults:
477+
- type: ALTERNATE_TYPE_DC
478+
value: default
459479
timeouts:
460480
name: timeouts
461481
title: Timeouts
@@ -468,6 +488,12 @@ spec:
468488
workload_identity_config:
469489
name: workload_identity_config
470490
title: Workload Identity Config
491+
properties:
492+
workload_pool:
493+
name: workload_pool
494+
title: Workload Pool
495+
regexValidation: ^.+\.svc\.id\.goog$
496+
validation: Workload pool must be in the format <project_id>.svc.id.goog.
471497
runtime:
472498
outputs:
473499
cluster_id:

modules/gke-standard-cluster/metadata.display.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,16 @@ spec:
375375
master_authorized_networks_config:
376376
name: master_authorized_networks_config
377377
title: Master Authorized Networks Config
378+
properties:
379+
cidr_blocks:
380+
name: cidr_blocks
381+
title: Cidr Blocks
382+
properties:
383+
cidr_block:
384+
name: cidr_block
385+
title: Cidr Block
386+
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]?)\/(3[0-2]|[12]?[0-9]))|((s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*\/(12[0-8]|1[01][0-9]|[1-9]?[0-9]))))$
387+
validation: Enter the valid [Cidr notation](https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing#CIDR_notation)
378388
mesh_certificates:
379389
name: mesh_certificates
380390
title: Mesh Certificates
@@ -406,6 +416,11 @@ spec:
406416
network:
407417
name: network
408418
title: Network
419+
regexValidation: ^[a-z][a-z0-9-]{0,60}[a-z0-9]$
420+
validation: Network name must start with a lowercase letter followed by up to 62 lowercase letters, numbers, or hyphens and cannot end with a hyphen.
421+
altDefaults:
422+
- type: ALTERNATE_TYPE_DC
423+
value: default
409424
network_policy:
410425
name: network_policy
411426
title: Network Policy
@@ -977,6 +992,11 @@ spec:
977992
subnetwork:
978993
name: subnetwork
979994
title: Subnetwork
995+
regexValidation: ^[a-z][a-z0-9-]{0,60}[a-z0-9]$
996+
validation: Network name must start with a lowercase letter followed by up to 62 lowercase letters, numbers, or hyphens and cannot end with a hyphen.
997+
altDefaults:
998+
- type: ALTERNATE_TYPE_DC
999+
value: default
9801000
timeouts:
9811001
name: timeouts
9821002
title: Timeouts
@@ -989,6 +1009,12 @@ spec:
9891009
workload_identity_config:
9901010
name: workload_identity_config
9911011
title: Workload Identity Config
1012+
properties:
1013+
workload_pool:
1014+
name: workload_pool
1015+
title: Workload Pool
1016+
regexValidation: ^.+\.svc\.id\.goog$
1017+
validation: Workload pool must be in the format <project_id>.svc.id.goog.
9921018
runtime:
9931019
outputs:
9941020
cluster_id:

0 commit comments

Comments
 (0)