You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/blueprint-validation.md
+18Lines changed: 18 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -121,6 +121,24 @@ ghpc:
121
121
error_message: "partition_name must be lowercase alphanumeric and max 10 characters."
122
122
```
123
123
124
+
### Range Validator
125
+
The `range` validator ensures that input variables (or their computed lengths/segment counts) fall within a specified numerical minimum and/or maximum. It supports validating individual numeric values, the number of elements in a list, or the count of segments in a delimited string (when an optional delimiter is specified). The optional length_check field (defaulting to false) determines whether to validate the value itself or the count of its elements/segments.
126
+
127
+
**Example definition in `metadata.yaml`:**
128
+
129
+
```yaml
130
+
ghpc:
131
+
validators:
132
+
- validator: range
133
+
inputs:
134
+
vars: [mount_runner.args]
135
+
min: 5
136
+
max: 5
137
+
length_check: true
138
+
delimiter: " "
139
+
error_message: "The 'mount_runner.args' field must contain exactly 5 elements."
140
+
```
141
+
124
142
Unlike blueprint-level validators, these are intrinsic to the module and ensure that the module receives data in the exact format required for its internal logic to function.
// processModuleSettings processes a list of names interpreted as module settings.
145
147
funcprocessModuleSettings(bp config.Blueprint, mod config.Module, group config.Group, modIdxint, list []string, optionalbool, handlerfunc(Target) error) error {
0 commit comments