From 8f184d6d4d07a4e8c2e4f20d50220ce4426c7902 Mon Sep 17 00:00:00 2001 From: amrkk123 Date: Tue, 12 Aug 2025 11:40:34 +0000 Subject: [PATCH 1/9] Adding UI validations for MiG and instance template --- .../instance_template/metadata.display.yaml | 215 +++++++++++++++++- modules/mig/metadata.display.yaml | 137 ++++++++++- 2 files changed, 343 insertions(+), 9 deletions(-) diff --git a/modules/instance_template/metadata.display.yaml b/modules/instance_template/metadata.display.yaml index ddb521b1..295f1658 100644 --- a/modules/instance_template/metadata.display.yaml +++ b/modules/instance_template/metadata.display.yaml @@ -4,7 +4,7 @@ # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, @@ -31,6 +31,17 @@ spec: access_config: name: access_config title: Access Config + properties: + network_tier: + name: network_tier + title: Network Tier + enumValueLabels: + - label: PREMIUM + value: PREMIUM + - label: STANDARD + value: STANDARD + - label: FIXED_STANDARD + value: FIXED_STANDARD altDefaults: - type: ALTERNATE_TYPE_DC value: @@ -39,15 +50,119 @@ spec: additional_disks: name: additional_disks title: Additional Disks + properties: + disk_type: + name: disk_type + title: Disk Type + enumValueLabels: + - label: pd-standard + value: pd-standard + - label: pd-balanced + value: pd-balanced + - label: pd-ssd + value: pd-ssd + - label: local-ssd + value: local-ssd + - label: hyperdisk-balanced + value: hyperdisk-balanced + - label: hyperdisk-throughput + value: hyperdisk-throughput + - label: hyperdisk-extreme + value: hyperdisk-extreme + interface: + name: interface + title: Interface + enumValueLabels: + - label: SCSI + value: SCSI + - label: NVME + value: NVME + mode: + name: mode + title: Mode + enumValueLabels: + - label: READ_WRITE + value: READ_WRITE + - label: READ_ONLY + value: READ_ONLY additional_networks: name: additional_networks title: Additional Networks + properties: + network: + name: network + title: Network + regexValidation: ^(?:projects\/[a-z0-9-]+\/)?global\/networks\/[a-z0-9-]{1,63}$ + validation: Invalid network format. Must be a network name or a self link. + subnetwork: + name: subnetwork + title: Subnetwork + regexValidation: ^(?:projects\/[a-z0-9-]+\/)?(?:regions\/[a-z0-9-]+\/)?subnetworks\/[a-z0-9-]{1,63}$ + validation: Invalid subnetwork format. Must be a subnetwork name or a self link. + network_ip: + name: network_ip + title: Network Ip + 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]?)$ + validation: Invalid IP address format. Must be a valid IPv4 address. + nic_type: + name: nic_type + title: Nic Type + enumValueLabels: + - label: VIRTIO_NET + value: VIRTIO_NET + - label: GVNIC + value: GVNIC + - label: MRDMA + value: MRDMA + - label: IRDMA + value: IRDMA + stack_type: + name: stack_type + title: Stack Type + enumValueLabels: + - label: IPV4_ONLY + value: IPV4_ONLY + - label: IPV6_ONLY + value: IPV6_ONLY + - label: IPV4_IPV6 + value: IPV4_IPV6 + access_config: + name: access_config + title: Access Config + properties: + network_tier: + name: network_tier + title: Network Tier + enumValueLabels: + - label: PREMIUM + value: PREMIUM + - label: STANDARD + value: STANDARD + - label: FIXED_STANDARD + value: FIXED_STANDARD + ipv6_access_config: + name: ipv6_access_config + title: Ipv6 Access Config + properties: + network_tier: + name: network_tier + title: Network Tier + enumValueLabels: + - label: PREMIUM + value: PREMIUM + - label: STANDARD + value: STANDARD alias_ip_range: name: alias_ip_range title: Alias Ip Range auto_delete: name: auto_delete title: Auto Delete + enumValueLabels: + - label: "true" + value: "true" + - label: "false" + value: "false" automatic_restart: name: automatic_restart title: Automatic Restart @@ -55,9 +170,21 @@ spec: can_ip_forward: name: can_ip_forward title: Can Ip Forward + enumValueLabels: + - label: "false" + value: "false" + - label: "true" + value: "true" confidential_instance_type: name: confidential_instance_type title: Confidential Instance Type + enumValueLabels: + - label: SEV + value: SEV + - label: SEV_SNP + value: SEV_SNP + - label: TDX + value: TDX create_service_account: name: create_service_account title: Create Service Account @@ -83,6 +210,21 @@ spec: name: disk_type title: Disk Type level: 1 + enumValueLabels: + - label: pd-standard + value: pd-standard + - label: pd-balanced + value: pd-balanced + - label: pd-ssd + value: pd-ssd + - label: local-ssd + value: local-ssd + - label: hyperdisk-balanced + value: hyperdisk-balanced + - label: hyperdisk-throughput + value: hyperdisk-throughput + - label: hyperdisk-extreme + value: hyperdisk-extreme enable_confidential_vm: name: enable_confidential_vm title: Enable Confidential Vm @@ -102,6 +244,15 @@ spec: ipv6_access_config: name: ipv6_access_config title: Ipv6 Access Config + properties: + network_tier: + name: network_tier + title: Network Tier + enumValueLabels: + - label: PREMIUM + value: PREMIUM + - label: STANDARD + value: STANDARD labels: name: labels title: Labels @@ -112,42 +263,63 @@ spec: maintenance_interval: name: maintenance_interval title: Maintenance Interval + enumValueLabels: + - label: PERIODIC + value: PERIODIC metadata: name: metadata title: Metadata min_cpu_platform: name: min_cpu_platform title: Min Cpu Platform - enumValueLabels: - - label: Intel Haswell - value: Intel Haswell - - label: Intel Skylake - value: Intel Skylake name_prefix: name: name_prefix title: Name Prefix - regexValidation: ^[a-z][a-z0-9-]{0,51}[a-z0-9]$ - validation: Use lowercase letters, numbers, and hyphens. Start with a letter and end with letter/number. Must be 53 characters or fewer. + regexValidation: ^.{1,54}$ + validation: Name prefix must be 54 characters or less. level: 1 network: name: network title: Network level: 1 + regexValidation: ^(?:projects\/[a-z0-9-]+\/)?global\/networks\/[a-z0-9-]{1,63}$ + validation: Invalid network format. Must be a network name or a self link. altDefaults: - type: ALTERNATE_TYPE_DC value: default network_ip: name: network_ip title: Network Ip + 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]?)$ + validation: Invalid IP address format. Must be a valid IPv4 address. nic_type: name: nic_type title: Nic Type + enumValueLabels: + - label: VIRTIO_NET + value: VIRTIO_NET + - label: GVNIC + value: GVNIC + - label: MRDMA + value: MRDMA + - label: IRDMA + value: IRDMA on_host_maintenance: name: on_host_maintenance title: On Host Maintenance + enumValueLabels: + - label: MIGRATE + value: MIGRATE + - label: TERMINATE + value: TERMINATE preemptible: name: preemptible title: Preemptible + enumValueLabels: + - label: "true" + value: "true" + - label: "false" + value: "false" project_id: name: project_id title: Project Id @@ -159,6 +331,12 @@ spec: resource_manager_tags: name: resource_manager_tags title: Resource Manager Tags + properties: + value: + name: value + title: Value + regexValidation: ^tagValues\/\d+$ + validation: Resource Manager tag values must be in the format 'tagValues/{tag_value_id}'. resource_policies: name: resource_policies title: Resource Policies @@ -168,6 +346,8 @@ spec: service_account_project_roles: name: service_account_project_roles title: Service Account Project Roles + 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_]+)$ + validation: Role must be a valid Google Cloud IAM role name, in the format of 'roles/{role_name}'. shielded_instance_config: name: shielded_instance_config title: Shielded Instance Config @@ -189,9 +369,21 @@ spec: spot_instance_termination_action: name: spot_instance_termination_action title: Spot Instance Termination Action + enumValueLabels: + - label: STOP + value: STOP + - label: DELETE + value: DELETE stack_type: name: stack_type title: Stack Type + enumValueLabels: + - label: IPV4_ONLY + value: IPV4_ONLY + - label: IPV4_IPV6 + value: IPV4_IPV6 + - label: IPV6_ONLY + value: IPV6_ONLY startup_script: name: startup_script title: Startup Script @@ -199,6 +391,8 @@ spec: name: subnetwork title: Subnetwork level: 1 + regexValidation: ^(?:projects\/[a-z0-9-]+\/)?(?:regions\/[a-z0-9-]+\/)?subnetworks\/[a-z0-9-]{1,63}$ + validation: Invalid subnetwork format. Must be a subnetwork name or a self link. subnetwork_project: name: subnetwork_project title: Subnetwork Project @@ -212,3 +406,8 @@ spec: total_egress_bandwidth_tier: name: total_egress_bandwidth_tier title: Total Egress Bandwidth Tier + enumValueLabels: + - label: DEFAULT + value: DEFAULT + - label: TIER_1 + value: TIER_1 diff --git a/modules/mig/metadata.display.yaml b/modules/mig/metadata.display.yaml index 3e238f23..6ac57528 100644 --- a/modules/mig/metadata.display.yaml +++ b/modules/mig/metadata.display.yaml @@ -4,7 +4,7 @@ # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, @@ -31,9 +31,20 @@ spec: autoscaler_name: name: autoscaler_name title: Autoscaler Name + regexValidation: ^[a-z][a-z0-9-]{0,61}[a-z0-9]$ + validation: Autoscaler name must be between 1 and 63 characters long, start with a lowercase letter, and can contain lowercase letters, numbers, and hyphens. autoscaling_cpu: name: autoscaling_cpu title: Autoscaling Cpu + properties: + predictive_method: + name: predictive_method + title: Predictive Method + enumValueLabels: + - label: NONE + value: NONE + - label: OPTIMIZE_AVAILABILITY + value: OPTIMIZE_AVAILABILITY autoscaling_enabled: name: autoscaling_enabled title: Autoscaling Enabled @@ -43,6 +54,17 @@ spec: autoscaling_metric: name: autoscaling_metric title: Autoscaling Metric + properties: + type: + name: type + title: Type + enumValueLabels: + - label: GAUGE + value: GAUGE + - label: DELTA_PER_SECOND + value: DELTA_PER_SECOND + - label: DELTA_PER_MINUTE + value: DELTA_PER_MINUTE autoscaling_mode: name: autoscaling_mode title: Autoscaling Mode @@ -63,19 +85,53 @@ spec: distribution_policy_target_shape: name: distribution_policy_target_shape title: Distribution Policy Target Shape + enumValueLabels: + - label: EVEN + value: EVEN + - label: BALANCED + value: BALANCED + - label: ANY + value: ANY + - label: ANY_SINGLE_ZONE + value: ANY_SINGLE_ZONE distribution_policy_zones: name: distribution_policy_zones title: Distribution Policy Zones health_check: name: health_check title: Health Check + properties: + type: + name: type + title: Type + enumValueLabels: + - label: HTTPS + value: HTTPS + - label: HTTP + value: HTTP + - label: TCP + value: TCP + - label: SSL + value: SSL + proxy_header: + name: proxy_header + title: Proxy Header + enumValueLabels: + - label: NONE + value: NONE + - label: PROXY_V1 + value: PROXY_V1 health_check_name: name: health_check_name title: Health Check Name + regexValidation: ^[a-z][a-z0-9-]{0,61}[a-z0-9]$ + validation: Health check name must be between 1 and 63 characters long, start with a lowercase letter, and can contain lowercase letters, numbers, and hyphens. hostname: name: hostname title: Hostname level: 1 + regexValidation: ^[a-z][a-z0-9-]{0,61}[a-z0-9]$ + validation: Hostname must be between 1 and 63 characters long, start with a lowercase letter, and can contain lowercase letters, numbers, and hyphens. instance_template: name: instance_template title: Instance Template @@ -104,6 +160,12 @@ spec: named_ports: name: named_ports title: Named Ports + properties: + name: + name: name + title: Port Name + regexValidation: ^[a-z]([-a-z0-9]{0,61}[a-z0-9])?$ + validation: Port name must be between 1 and 63 characters long, start with a lowercase letter, and can contain lowercase letters, numbers, and hyphens. project_id: name: project_id title: Project Id @@ -114,12 +176,36 @@ spec: scaling_schedules: name: scaling_schedules title: Scaling Schedules + properties: + schedule: + name: schedule + title: Schedule + regexValidation: ^(\*|([0-9]|1[0-9]|2[0-9]|3[0-9]|4[0-9]|5[0-9])(-([0-9]|1[0-9]|2[0-9]|3[0-9]|4[0-9]|5[0-9]))?)(,(\*|([0-9]|1[0-9]|2[0-9]|3[0-9]|4[0-9]|5[0-9])(-([0-9]|1[0-9]|2[0-9]|3[0-9]|4[0-9]|5[0-9]))?))* (\*|([0-9]|1[0-9]|2[0-3])(-([0-9]|1[0-9]|2[0-3]))?)(,(\*|([0-9]|1[0-9]|2[0-3])(-([0-9]|1[0-9]|2[0-3]))?))* (\*|([1-9]|1[0-9]|2[0-9]|3[0-1])(-([1-9]|1[0-9]|2[0-9]|3[0-1]))?)(,(\*|([1-9]|1[0-9]|2[0-9]|3[0-1])(-([1-9]|1[0-9]|2[0-9]|3[0-1]))?))* (\*|([1-9]|1[0-2])(-([1-9]|1[0-2]))?)(,(\*|([1-9]|1[0-2])(-([1-9]|1[0-2]))?))* (\*|([0-6])(-([0-6]))?)(,(\*|([0-6])(-([0-6]))?))*$ + validation: Schedule must be in cron format. stateful_disks: name: stateful_disks title: Stateful Disks + properties: + delete_rule: + name: delete_rule + title: Delete Rule + enumValueLabels: + - label: NEVER + value: NEVER + - label: ON_PERMANENT_INSTANCE_DELETION + value: ON_PERMANENT_INSTANCE_DELETION stateful_ips: name: stateful_ips title: Stateful Ips + properties: + delete_rule: + name: delete_rule + title: Delete Rule + enumValueLabels: + - label: NEVER + value: NEVER + - label: ON_PERMANENT_INSTANCE_DELETION + value: ON_PERMANENT_INSTANCE_DELETION target_pools: name: target_pools title: Target Pools @@ -130,6 +216,55 @@ spec: update_policy: name: update_policy title: Update Policy + properties: + instance_redistribution_type: + name: instance_redistribution_type + title: Instance Redistribution Type + enumValueLabels: + - label: PROACTIVE + value: PROACTIVE + - label: NONE + value: NONE + replacement_method: + name: replacement_method + title: Replacement Method + enumValueLabels: + - label: RECREATE + value: RECREATE + - label: SUBSTITUTE + value: SUBSTITUTE + minimal_action: + name: minimal_action + title: Minimal Action + enumValueLabels: + - label: RESTART + value: RESTART + - label: REPLACE + value: REPLACE + - label: REFRESH + value: REFRESH + - label: NONE + value: NONE + type: + name: type + title: Type + enumValueLabels: + - label: PROACTIVE + value: PROACTIVE + - label: OPPORTUNISTIC + value: OPPORTUNISTIC + most_disruptive_allowed_action: + name: most_disruptive_allowed_action + title: Most Disruptive Allowed Action + enumValueLabels: + - label: REPLACE + value: REPLACE + - label: RESTART + value: RESTART + - label: REFRESH + value: REFRESH + - label: NONE + value: NONE wait_for_instances: name: wait_for_instances title: Wait For Instances From b20e1b7b10f0cbd7fa35fa1873bc7ef3bb3a9770 Mon Sep 17 00:00:00 2001 From: amrkk123 Date: Tue, 12 Aug 2025 11:57:40 +0000 Subject: [PATCH 2/9] Removing whitespaces --- modules/instance_template/metadata.display.yaml | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/modules/instance_template/metadata.display.yaml b/modules/instance_template/metadata.display.yaml index 295f1658..a54752ba 100644 --- a/modules/instance_template/metadata.display.yaml +++ b/modules/instance_template/metadata.display.yaml @@ -68,7 +68,7 @@ spec: - label: hyperdisk-throughput value: hyperdisk-throughput - label: hyperdisk-extreme - value: hyperdisk-extreme + value: hyperdisk-extreme interface: name: interface title: Interface @@ -123,7 +123,7 @@ spec: - label: IPV4_ONLY value: IPV4_ONLY - label: IPV6_ONLY - value: IPV6_ONLY + value: IPV6_ONLY - label: IPV4_IPV6 value: IPV4_IPV6 access_config: @@ -184,7 +184,7 @@ spec: - label: SEV_SNP value: SEV_SNP - label: TDX - value: TDX + value: TDX create_service_account: name: create_service_account title: Create Service Account @@ -224,7 +224,7 @@ spec: - label: hyperdisk-throughput value: hyperdisk-throughput - label: hyperdisk-extreme - value: hyperdisk-extreme + value: hyperdisk-extreme enable_confidential_vm: name: enable_confidential_vm title: Enable Confidential Vm @@ -331,12 +331,6 @@ spec: resource_manager_tags: name: resource_manager_tags title: Resource Manager Tags - properties: - value: - name: value - title: Value - regexValidation: ^tagValues\/\d+$ - validation: Resource Manager tag values must be in the format 'tagValues/{tag_value_id}'. resource_policies: name: resource_policies title: Resource Policies @@ -383,7 +377,7 @@ spec: - label: IPV4_IPV6 value: IPV4_IPV6 - label: IPV6_ONLY - value: IPV6_ONLY + value: IPV6_ONLY startup_script: name: startup_script title: Startup Script From 974773216f23efc082859abe95d4d8e8c0d8acd1 Mon Sep 17 00:00:00 2001 From: amrkk123 Date: Tue, 12 Aug 2025 13:55:28 +0000 Subject: [PATCH 3/9] Remove remaining whitespace --- modules/instance_template/metadata.display.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/instance_template/metadata.display.yaml b/modules/instance_template/metadata.display.yaml index a54752ba..5c2835af 100644 --- a/modules/instance_template/metadata.display.yaml +++ b/modules/instance_template/metadata.display.yaml @@ -139,7 +139,7 @@ spec: - label: STANDARD value: STANDARD - label: FIXED_STANDARD - value: FIXED_STANDARD + value: FIXED_STANDARD ipv6_access_config: name: ipv6_access_config title: Ipv6 Access Config From bc175141a2202339c7c2ce4a6be7bc92b31808d4 Mon Sep 17 00:00:00 2001 From: amrkk123 Date: Tue, 19 Aug 2025 10:03:47 +0000 Subject: [PATCH 4/9] Fixing whitespace --- modules/instance_template/metadata.display.yaml | 2 +- modules/mig/metadata.display.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/instance_template/metadata.display.yaml b/modules/instance_template/metadata.display.yaml index 5c2835af..04ce9538 100644 --- a/modules/instance_template/metadata.display.yaml +++ b/modules/instance_template/metadata.display.yaml @@ -4,7 +4,7 @@ # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, diff --git a/modules/mig/metadata.display.yaml b/modules/mig/metadata.display.yaml index 6ac57528..833e54cd 100644 --- a/modules/mig/metadata.display.yaml +++ b/modules/mig/metadata.display.yaml @@ -4,7 +4,7 @@ # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, From 4a4559ea35d407a90605cc31221d7ef5473a7343 Mon Sep 17 00:00:00 2001 From: amrkk123 Date: Tue, 19 Aug 2025 10:06:42 +0000 Subject: [PATCH 5/9] Fixing whitespace --- modules/instance_template/metadata.display.yaml | 2 +- modules/mig/metadata.display.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/instance_template/metadata.display.yaml b/modules/instance_template/metadata.display.yaml index 04ce9538..a671fdc3 100644 --- a/modules/instance_template/metadata.display.yaml +++ b/modules/instance_template/metadata.display.yaml @@ -4,7 +4,7 @@ # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, diff --git a/modules/mig/metadata.display.yaml b/modules/mig/metadata.display.yaml index 833e54cd..916a6525 100644 --- a/modules/mig/metadata.display.yaml +++ b/modules/mig/metadata.display.yaml @@ -4,7 +4,7 @@ # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, From 0f6a66c1eb78183f317bbb89e21067161f64e73f Mon Sep 17 00:00:00 2001 From: amrkk123 Date: Wed, 20 Aug 2025 11:00:06 +0000 Subject: [PATCH 6/9] changing regex for network and subnetwork --- .../instance_template/metadata.display.yaml | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/modules/instance_template/metadata.display.yaml b/modules/instance_template/metadata.display.yaml index a671fdc3..5801d32c 100644 --- a/modules/instance_template/metadata.display.yaml +++ b/modules/instance_template/metadata.display.yaml @@ -4,7 +4,7 @@ # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, @@ -92,12 +92,12 @@ spec: network: name: network title: Network - regexValidation: ^(?:projects\/[a-z0-9-]+\/)?global\/networks\/[a-z0-9-]{1,63}$ + regexValidation: ^(?:[a-z0-9-]{1,63}|projects\/[a-z0-9-]+\/global\/networks\/[a-z0-9-]{1,63})$ validation: Invalid network format. Must be a network name or a self link. subnetwork: name: subnetwork title: Subnetwork - regexValidation: ^(?:projects\/[a-z0-9-]+\/)?(?:regions\/[a-z0-9-]+\/)?subnetworks\/[a-z0-9-]{1,63}$ + regexValidation: ^(?:[a-z0-9-]{1,63}|(?:projects\/[a-z0-9-]+\/)?(?:regions\/[a-z0-9-]+\/)?subnetworks\/[a-z0-9-]{1,63})$ validation: Invalid subnetwork format. Must be a subnetwork name or a self link. network_ip: name: network_ip @@ -272,17 +272,22 @@ spec: min_cpu_platform: name: min_cpu_platform title: Min Cpu Platform + enumValueLabels: + - label: Intel Haswell + value: Intel Haswell + - label: Intel Skylake + value: Intel Skylake name_prefix: name: name_prefix title: Name Prefix - regexValidation: ^.{1,54}$ - validation: Name prefix must be 54 characters or less. + regexValidation: ^[a-z][a-z0-9-]{0,51}[a-z0-9]$ + validation: Use lowercase letters, numbers, and hyphens. Start with a letter and end with letter/number. Must be 53 characters or fewer. level: 1 network: name: network title: Network level: 1 - regexValidation: ^(?:projects\/[a-z0-9-]+\/)?global\/networks\/[a-z0-9-]{1,63}$ + regexValidation: ^(?:[a-z0-9-]{1,63}|projects\/[a-z0-9-]+\/global\/networks\/[a-z0-9-]{1,63})$ validation: Invalid network format. Must be a network name or a self link. altDefaults: - type: ALTERNATE_TYPE_DC @@ -385,7 +390,7 @@ spec: name: subnetwork title: Subnetwork level: 1 - regexValidation: ^(?:projects\/[a-z0-9-]+\/)?(?:regions\/[a-z0-9-]+\/)?subnetworks\/[a-z0-9-]{1,63}$ + regexValidation: ^(?:[a-z0-9-]{1,63}|(?:projects\/[a-z0-9-]+\/)?(?:regions\/[a-z0-9-]+\/)?subnetworks\/[a-z0-9-]{1,63})$ validation: Invalid subnetwork format. Must be a subnetwork name or a self link. subnetwork_project: name: subnetwork_project From 5eca863291371f2ad188a4bbbe9363ed409927d3 Mon Sep 17 00:00:00 2001 From: amrkk123 Date: Wed, 20 Aug 2025 11:14:29 +0000 Subject: [PATCH 7/9] fix whitespace --- modules/instance_template/metadata.display.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/instance_template/metadata.display.yaml b/modules/instance_template/metadata.display.yaml index 5801d32c..a057b889 100644 --- a/modules/instance_template/metadata.display.yaml +++ b/modules/instance_template/metadata.display.yaml @@ -4,7 +4,7 @@ # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, From f76d43b5a73d1fee206c1e58f5d35b468627724d Mon Sep 17 00:00:00 2001 From: amrkk123 Date: Fri, 22 Aug 2025 13:40:31 +0000 Subject: [PATCH 8/9] fixing escape for regex --- modules/instance_template/metadata.display.yaml | 10 +++++----- modules/mig/metadata.display.yaml | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/modules/instance_template/metadata.display.yaml b/modules/instance_template/metadata.display.yaml index a057b889..5302abd7 100644 --- a/modules/instance_template/metadata.display.yaml +++ b/modules/instance_template/metadata.display.yaml @@ -92,12 +92,12 @@ spec: network: name: network title: Network - regexValidation: ^(?:[a-z0-9-]{1,63}|projects\/[a-z0-9-]+\/global\/networks\/[a-z0-9-]{1,63})$ + regexValidation: "^(?:[a-z0-9-]{1,63}|projects\\/[a-z0-9-]+\\/global\\/networks\\/[a-z0-9-]{1,63})$" validation: Invalid network format. Must be a network name or a self link. subnetwork: name: subnetwork title: Subnetwork - regexValidation: ^(?:[a-z0-9-]{1,63}|(?:projects\/[a-z0-9-]+\/)?(?:regions\/[a-z0-9-]+\/)?subnetworks\/[a-z0-9-]{1,63})$ + regexValidation: "^(?:[a-z0-9-]{1,63}|(?:projects\\/[a-z0-9-]+\\/)?(?:regions\\/[a-z0-9-]+\\/)?subnetworks\\/[a-z0-9-]{1,63})$" validation: Invalid subnetwork format. Must be a subnetwork name or a self link. network_ip: name: network_ip @@ -287,7 +287,7 @@ spec: name: network title: Network level: 1 - regexValidation: ^(?:[a-z0-9-]{1,63}|projects\/[a-z0-9-]+\/global\/networks\/[a-z0-9-]{1,63})$ + regexValidation: "^(?:[a-z0-9-]{1,63}|projects\\/[a-z0-9-]+\\/global\\/networks\\/[a-z0-9-]{1,63})$" validation: Invalid network format. Must be a network name or a self link. altDefaults: - type: ALTERNATE_TYPE_DC @@ -345,7 +345,7 @@ spec: service_account_project_roles: name: service_account_project_roles title: Service Account Project Roles - 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_]+)$ + 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_]+)$" validation: Role must be a valid Google Cloud IAM role name, in the format of 'roles/{role_name}'. shielded_instance_config: name: shielded_instance_config @@ -390,7 +390,7 @@ spec: name: subnetwork title: Subnetwork level: 1 - regexValidation: ^(?:[a-z0-9-]{1,63}|(?:projects\/[a-z0-9-]+\/)?(?:regions\/[a-z0-9-]+\/)?subnetworks\/[a-z0-9-]{1,63})$ + regexValidation: "^(?:[a-z0-9-]{1,63}|(?:projects\\/[a-z0-9-]+\\/)?(?:regions\\/[a-z0-9-]+\\/)?subnetworks\\/[a-z0-9-]{1,63})$" validation: Invalid subnetwork format. Must be a subnetwork name or a self link. subnetwork_project: name: subnetwork_project diff --git a/modules/mig/metadata.display.yaml b/modules/mig/metadata.display.yaml index 916a6525..f2c591b3 100644 --- a/modules/mig/metadata.display.yaml +++ b/modules/mig/metadata.display.yaml @@ -4,7 +4,7 @@ # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, @@ -180,7 +180,7 @@ spec: schedule: name: schedule title: Schedule - regexValidation: ^(\*|([0-9]|1[0-9]|2[0-9]|3[0-9]|4[0-9]|5[0-9])(-([0-9]|1[0-9]|2[0-9]|3[0-9]|4[0-9]|5[0-9]))?)(,(\*|([0-9]|1[0-9]|2[0-9]|3[0-9]|4[0-9]|5[0-9])(-([0-9]|1[0-9]|2[0-9]|3[0-9]|4[0-9]|5[0-9]))?))* (\*|([0-9]|1[0-9]|2[0-3])(-([0-9]|1[0-9]|2[0-3]))?)(,(\*|([0-9]|1[0-9]|2[0-3])(-([0-9]|1[0-9]|2[0-3]))?))* (\*|([1-9]|1[0-9]|2[0-9]|3[0-1])(-([1-9]|1[0-9]|2[0-9]|3[0-1]))?)(,(\*|([1-9]|1[0-9]|2[0-9]|3[0-1])(-([1-9]|1[0-9]|2[0-9]|3[0-1]))?))* (\*|([1-9]|1[0-2])(-([1-9]|1[0-2]))?)(,(\*|([1-9]|1[0-2])(-([1-9]|1[0-2]))?))* (\*|([0-6])(-([0-6]))?)(,(\*|([0-6])(-([0-6]))?))*$ + regexValidation: "^(\\*|([0-9]|1[0-9]|2[0-9]|3[0-9]|4[0-9]|5[0-9])(-([0-9]|1[0-9]|2[0-9]|3[0-9]|4[0-9]|5[0-9]))?)(,(\\*|([0-9]|1[0-9]|2[0-9]|3[0-9]|4[0-9]|5[0-9])(-([0-9]|1[0-9]|2[0-9]|3[0-9]|4[0-9]|5[0-9]))?))* (\\*|([0-9]|1[0-9]|2[0-3])(-([0-9]|1[0-9]|2[0-3]))?)(,(\\*|([0-9]|1[0-9]|2[0-3])(-([0-9]|1[0-9]|2[0-3]))?))* (\\*|([1-9]|1[0-9]|2[0-9]|3[0-1])(-([1-9]|1[0-9]|2[0-9]|3[0-1]))?)(,(\\*|([1-9]|1[0-9]|2[0-9]|3[0-1])(-([1-9]|1[0-9]|2[0-9]|3[0-1]))?))* (\\*|([1-9]|1[0-2])(-([1-9]|1[0-2]))?)(,(\\*|([1-9]|1[0-2])(-([1-9]|1[0-2]))?))* (\\*|([0-6])(-([0-6]))?)(,(\\*|([0-6])(-([0-6]))?))*$" validation: Schedule must be in cron format. stateful_disks: name: stateful_disks From 2eb1e9304230a8b841402de77a81e4f0b682b61c Mon Sep 17 00:00:00 2001 From: amrkk123 Date: Tue, 26 Aug 2025 06:18:45 +0000 Subject: [PATCH 9/9] fix regex escape in instance template and mig --- modules/instance_template/metadata.display.yaml | 14 +++++++------- modules/mig/metadata.display.yaml | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/modules/instance_template/metadata.display.yaml b/modules/instance_template/metadata.display.yaml index 5302abd7..d62f4ab6 100644 --- a/modules/instance_template/metadata.display.yaml +++ b/modules/instance_template/metadata.display.yaml @@ -92,17 +92,17 @@ spec: network: name: network title: Network - regexValidation: "^(?:[a-z0-9-]{1,63}|projects\\/[a-z0-9-]+\\/global\\/networks\\/[a-z0-9-]{1,63})$" + regexValidation: "^(?:[a-z0-9-]{1,63}|projects/[a-z0-9-]+/global/networks/[a-z0-9-]{1,63})$" validation: Invalid network format. Must be a network name or a self link. subnetwork: name: subnetwork title: Subnetwork - regexValidation: "^(?:[a-z0-9-]{1,63}|(?:projects\\/[a-z0-9-]+\\/)?(?:regions\\/[a-z0-9-]+\\/)?subnetworks\\/[a-z0-9-]{1,63})$" + regexValidation: "^(?:[a-z0-9-]{1,63}|(?:projects/[a-z0-9-]+/)?(?:regions/[a-z0-9-]+/)?subnetworks/[a-z0-9-]{1,63})$" validation: Invalid subnetwork format. Must be a subnetwork name or a self link. network_ip: name: network_ip title: Network Ip - 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]?)$ + 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]?)$" validation: Invalid IP address format. Must be a valid IPv4 address. nic_type: name: nic_type @@ -287,7 +287,7 @@ spec: name: network title: Network level: 1 - regexValidation: "^(?:[a-z0-9-]{1,63}|projects\\/[a-z0-9-]+\\/global\\/networks\\/[a-z0-9-]{1,63})$" + regexValidation: "^(?:[a-z0-9-]{1,63}|projects/[a-z0-9-]+/global/networks/[a-z0-9-]{1,63})$" validation: Invalid network format. Must be a network name or a self link. altDefaults: - type: ALTERNATE_TYPE_DC @@ -295,7 +295,7 @@ spec: network_ip: name: network_ip title: Network Ip - 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]?)$ + 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]?)$" validation: Invalid IP address format. Must be a valid IPv4 address. nic_type: name: nic_type @@ -345,7 +345,7 @@ spec: service_account_project_roles: name: service_account_project_roles title: Service Account Project Roles - 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_]+)$" + 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_]+)$" validation: Role must be a valid Google Cloud IAM role name, in the format of 'roles/{role_name}'. shielded_instance_config: name: shielded_instance_config @@ -390,7 +390,7 @@ spec: name: subnetwork title: Subnetwork level: 1 - regexValidation: "^(?:[a-z0-9-]{1,63}|(?:projects\\/[a-z0-9-]+\\/)?(?:regions\\/[a-z0-9-]+\\/)?subnetworks\\/[a-z0-9-]{1,63})$" + regexValidation: "^(?:[a-z0-9-]{1,63}|(?:projects/[a-z0-9-]+/)?(?:regions/[a-z0-9-]+/)?subnetworks/[a-z0-9-]{1,63})$" validation: Invalid subnetwork format. Must be a subnetwork name or a self link. subnetwork_project: name: subnetwork_project diff --git a/modules/mig/metadata.display.yaml b/modules/mig/metadata.display.yaml index f2c591b3..48787f4e 100644 --- a/modules/mig/metadata.display.yaml +++ b/modules/mig/metadata.display.yaml @@ -135,7 +135,7 @@ spec: instance_template: name: instance_template title: Instance Template - regexValidation: ^https:\/\/www\.googleapis\.com\/compute\/v1\/projects\/[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?\/(?:global|regions\/[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?)\/instanceTemplates\/[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?$ + regexValidation: "^https://www.googleapis.com/compute/v1/projects/[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?/(?:global|regions/[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?)/instanceTemplates/[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?$" validation: Invalid template url format, valid format is either https://www.googleapis.com/compute/v1/projects/{project}/regions/{region}/instanceTemplates/{template_name} (regional) or https://www.googleapis.com/compute/v1/projects/{project}/global/instanceTemplates/{template_name} (global). labels: name: labels @@ -180,7 +180,7 @@ spec: schedule: name: schedule title: Schedule - regexValidation: "^(\\*|([0-9]|1[0-9]|2[0-9]|3[0-9]|4[0-9]|5[0-9])(-([0-9]|1[0-9]|2[0-9]|3[0-9]|4[0-9]|5[0-9]))?)(,(\\*|([0-9]|1[0-9]|2[0-9]|3[0-9]|4[0-9]|5[0-9])(-([0-9]|1[0-9]|2[0-9]|3[0-9]|4[0-9]|5[0-9]))?))* (\\*|([0-9]|1[0-9]|2[0-3])(-([0-9]|1[0-9]|2[0-3]))?)(,(\\*|([0-9]|1[0-9]|2[0-3])(-([0-9]|1[0-9]|2[0-3]))?))* (\\*|([1-9]|1[0-9]|2[0-9]|3[0-1])(-([1-9]|1[0-9]|2[0-9]|3[0-1]))?)(,(\\*|([1-9]|1[0-9]|2[0-9]|3[0-1])(-([1-9]|1[0-9]|2[0-9]|3[0-1]))?))* (\\*|([1-9]|1[0-2])(-([1-9]|1[0-2]))?)(,(\\*|([1-9]|1[0-2])(-([1-9]|1[0-2]))?))* (\\*|([0-6])(-([0-6]))?)(,(\\*|([0-6])(-([0-6]))?))*$" + regexValidation: "^(*|([0-9]|1[0-9]|2[0-9]|3[0-9]|4[0-9]|5[0-9])(-([0-9]|1[0-9]|2[0-9]|3[0-9]|4[0-9]|5[0-9]))?)(,(*|([0-9]|1[0-9]|2[0-9]|3[0-9]|4[0-9]|5[0-9])(-([0-9]|1[0-9]|2[0-9]|3[0-9]|4[0-9]|5[0-9]))?))* (*|([0-9]|1[0-9]|2[0-3])(-([0-9]|1[0-9]|2[0-3]))?)(,(*|([0-9]|1[0-9]|2[0-3])(-([0-9]|1[0-9]|2[0-3]))?))* (*|([1-9]|1[0-9]|2[0-9]|3[0-1])(-([1-9]|1[0-9]|2[0-9]|3[0-1]))?)(,(*|([1-9]|1[0-9]|2[0-9]|3[0-1])(-([1-9]|1[0-9]|2[0-9]|3[0-1]))?))* (*|([1-9]|1[0-2])(-([1-9]|1[0-2]))?)(,(*|([1-9]|1[0-2])(-([1-9]|1[0-2]))?))* (*|([0-6])(-([0-6]))?)(,(*|([0-6])(-([0-6]))?))*$" validation: Schedule must be in cron format. stateful_disks: name: stateful_disks