Skip to content

Commit 1968bf7

Browse files
feat: Add DA input UI regex validation (#70)
1 parent 52ef01d commit 1968bf7

File tree

2 files changed

+21
-3
lines changed

2 files changed

+21
-3
lines changed

ibm_catalog.json

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,18 @@
109109
},
110110
{
111111
"key": "prefix",
112-
"required": true
112+
"required": true,
113+
"default_value": "dev",
114+
"random_string": {
115+
"length": 4
116+
},
117+
"value_constraints": [
118+
{
119+
"type": "regex",
120+
"description": "Prefix must begin with a lowercase letter and may contain only lowercase letters, digits, and hyphens '-'. It must not end with a hyphen('-'), and cannot contain consecutive hyphens ('--'). It should not exceed 16 characters.",
121+
"value": "^$|^__NULL__$|^[a-z](?!.*--)(?:[a-z0-9-]{0,14}[a-z0-9])?$"
122+
}
123+
]
113124
},
114125
{
115126
"key": "existing_cluster_id",
@@ -254,7 +265,14 @@
254265
"key": "install_odf_cluster_addon"
255266
},
256267
{
257-
"key": "odf_version"
268+
"key": "odf_version",
269+
"value_constraints": [
270+
{
271+
"type": "regex",
272+
"description": "The value provided for 'odf_version' is not valid.",
273+
"value": "^[0-9]+\\.[0-9]+\\.[0-9]+$"
274+
}
275+
]
258276
},
259277
{
260278
"key": "odf_config"

solutions/fully-configurable/variables.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ variable "provider_visibility" {
2222
variable "prefix" {
2323
type = string
2424
nullable = true
25-
description = "The prefix to be added to all resources created by this solution. To skip using a prefix, set this value to null or an empty string. The prefix must begin with a lowercase letter and may contain only lowercase letters, digits, and hyphens '-'. It should not exceed 16 characters, must not end with a hyphen('-'), and can not contain consecutive hyphens ('--'). Example: prod-wx-cp4d. [Learn more](https://terraform-ibm-modules.github.io/documentation/#/prefix.md)."
25+
description = "The prefix to add to all resources that this solution creates (e.g `prod`, `test`, `dev`). To skip using a prefix, set this value to null or an empty string. [Learn more](https://terraform-ibm-modules.github.io/documentation/#/prefix.md)."
2626

2727
validation {
2828
# - null and empty string is allowed

0 commit comments

Comments
 (0)