Skip to content

Commit 90548a8

Browse files
add allowed_enum validators to various modules (#5106)
1 parent 2a70195 commit 90548a8

File tree

6 files changed

+161
-0
lines changed

6 files changed

+161
-0
lines changed

community/modules/compute/schedmd-slurm-gcp-v6-nodeset-dynamic/metadata.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,23 @@ spec:
1818
services: [compute.googleapis.com]
1919
ghpc:
2020
inject_module_id: name
21+
validators:
22+
- validator: allowed_enum
23+
inputs:
24+
vars: [bandwidth_tier]
25+
allowed:
26+
- platform_default
27+
- virtio_enabled
28+
- gvnic_enabled
29+
- tier_1_enabled
30+
allow_null: false
31+
error_message: "Allowed values for bandwidth_tier are 'platform_default', 'virtio_enabled', 'gvnic_enabled', or 'tier_1_enabled'."
32+
33+
- validator: allowed_enum
34+
inputs:
35+
vars: [on_host_maintenance]
36+
allowed:
37+
- MIGRATE
38+
- TERMINATE
39+
allow_null: false
40+
error_message: "Allowed values for on_host_maintenance are 'MIGRATE' or 'TERMINATE'."

community/modules/compute/schedmd-slurm-gcp-v6-nodeset/metadata.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,22 @@ spec:
1919
ghpc:
2020
inject_module_id: name
2121
has_to_be_used: true
22+
validators:
23+
- validator: allowed_enum
24+
inputs:
25+
vars: [bandwidth_tier]
26+
allowed:
27+
- platform_default
28+
- virtio_enabled
29+
- gvnic_enabled
30+
- tier_1_enabled
31+
allow_null: false
32+
error_message: "Allowed values for bandwidth_tier are 'platform_default', 'virtio_enabled', 'gvnic_enabled', or 'tier_1_enabled'."
33+
- validator: allowed_enum
34+
inputs:
35+
vars: [on_host_maintenance]
36+
allowed:
37+
- MIGRATE
38+
- TERMINATE
39+
allow_null: false
40+
error_message: "Allowed values for on_host_maintenance are 'MIGRATE' or 'TERMINATE'."

modules/compute/vm-instance/metadata.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,23 @@ spec:
1717
requirements:
1818
services:
1919
- compute.googleapis.com
20+
ghpc:
21+
validators:
22+
- validator: allowed_enum
23+
inputs:
24+
vars: [on_host_maintenance]
25+
allowed:
26+
- MIGRATE
27+
- TERMINATE
28+
allow_null: true
29+
error_message: "on_host_maintenance must be either 'MIGRATE' or 'TERMINATE'."
30+
31+
- validator: allowed_enum
32+
inputs:
33+
vars: [bandwidth_tier]
34+
allowed:
35+
- not_enabled
36+
- gvnic_enabled
37+
- tier_1_enabled
38+
allow_null: false
39+
error_message: "Allowed values for bandwidth_tier are 'not_enabled', 'gvnic_enabled', or 'tier_1_enabled'."

modules/file-system/filestore/metadata.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,36 @@ spec:
1717
requirements:
1818
services:
1919
- file.googleapis.com
20+
21+
ghpc:
22+
validators:
23+
- validator: allowed_enum
24+
inputs:
25+
vars: [filestore_tier]
26+
allowed:
27+
- BASIC_HDD
28+
- BASIC_SSD
29+
- HIGH_SCALE_SSD
30+
- ZONAL
31+
- REGIONAL
32+
- ENTERPRISE
33+
allow_null: false
34+
error_message: "Invalid value for filestore_tier. The value must be one of: BASIC_HDD, BASIC_SSD, HIGH_SCALE_SSD, ZONAL, REGIONAL, ENTERPRISE."
35+
36+
- validator: allowed_enum
37+
inputs:
38+
vars: [connect_mode]
39+
allowed:
40+
- DIRECT_PEERING
41+
- PRIVATE_SERVICE_ACCESS
42+
allow_null: false
43+
error_message: "'connect_mode' must be either DIRECT_PEERING or PRIVATE_SERVICE_ACCESS."
44+
45+
- validator: allowed_enum
46+
inputs:
47+
vars: [protocol]
48+
allowed:
49+
- NFS_V3
50+
- NFS_V4_1
51+
allow_null: false
52+
error_message: "Allowed values for protocol are 'NFS_V3' or 'NFS_V4_1'."

modules/file-system/gke-storage/metadata.yaml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,43 @@
1616
spec:
1717
requirements:
1818
services: []
19+
ghpc:
20+
validators:
21+
- validator: allowed_enum
22+
inputs:
23+
vars: [storage_type]
24+
allowed: [parallelstore, hyperdisk-balanced, hyperdisk-throughput, hyperdisk-extreme]
25+
case_sensitive: false
26+
error_message: "Invalid storage_type. Allowed: Parallelstore, Hyperdisk-balanced, Hyperdisk-throughput, Hyperdisk-extreme."
27+
28+
- validator: allowed_enum
29+
inputs:
30+
vars: [access_mode]
31+
allowed:
32+
- ReadWriteOnce
33+
- ReadOnlyMany
34+
- ReadWriteMany
35+
- ReadWriteOncePod
36+
case_sensitive: false
37+
allow_null: false
38+
error_message: "Allowed values for access_mode are 'ReadWriteOnce', 'ReadOnlyMany', 'ReadWriteMany', or 'ReadWriteOncePod'."
39+
40+
- validator: allowed_enum
41+
inputs:
42+
vars: [sc_volume_binding_mode]
43+
allowed:
44+
- Immediate
45+
- WaitForFirstConsumer
46+
case_sensitive: false
47+
allow_null: false
48+
error_message: "Allowed values for sc_volume_binding_mode are 'Immediate' or 'WaitForFirstConsumer'."
49+
50+
- validator: allowed_enum
51+
inputs:
52+
vars: [sc_reclaim_policy]
53+
allowed:
54+
- Retain
55+
- Delete
56+
case_sensitive: false
57+
allow_null: false
58+
error_message: "Allowed values for sc_reclaim_policy are 'Retain' or 'Delete'."

modules/scheduler/batch-job-template/metadata.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,32 @@ spec:
2020
- compute.googleapis.com
2121
ghpc:
2222
inject_module_id: job_id
23+
validators:
24+
- validator: allowed_enum
25+
inputs:
26+
vars: [on_host_maintenance]
27+
allowed:
28+
- MIGRATE
29+
- TERMINATE
30+
allow_null: true
31+
error_message: "on_host_maintenance must be either 'MIGRATE' or 'TERMINATE'. If omitted, the system will choose the appropriate default based on your hardware configuration."
32+
33+
- validator: allowed_enum
34+
inputs:
35+
vars: [gcloud_version]
36+
allowed:
37+
- alpha
38+
- beta
39+
- ""
40+
allow_null: false
41+
error_message: "Allowed values for gcloud_version are 'alpha', 'beta', or '' (empty string)."
42+
43+
- validator: allowed_enum
44+
inputs:
45+
vars: [log_policy]
46+
allowed:
47+
- CLOUD_LOGGING
48+
- PATH
49+
- DESTINATION_UNSPECIFIED
50+
allow_null: false
51+
error_message: "Allowed values for log_policy are 'CLOUD_LOGGING', 'PATH', or 'DESTINATION_UNSPECIFIED'."

0 commit comments

Comments
 (0)