Skip to content

Commit 69de277

Browse files
authored
fix: add_validation_block_in_ocp_version (#75)
1 parent 15a9160 commit 69de277

File tree

2 files changed

+21
-9
lines changed

2 files changed

+21
-9
lines changed

module-metadata.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
],
2828
"pos": {
2929
"filename": "variables.tf",
30-
"line": 93
30+
"line": 105
3131
}
3232
},
3333
"cos_name": {
@@ -36,7 +36,7 @@
3636
"description": "Name of the COS instance to provision. New instance only provisioned if `use_existing_cos = false`. Default: `\u003ccluster_name\u003e_cos`",
3737
"pos": {
3838
"filename": "variables.tf",
39-
"line": 123
39+
"line": 135
4040
}
4141
},
4242
"disable_public_endpoint": {
@@ -50,7 +50,7 @@
5050
],
5151
"pos": {
5252
"filename": "variables.tf",
53-
"line": 105
53+
"line": 117
5454
}
5555
},
5656
"existing_cos_id": {
@@ -59,7 +59,7 @@
5959
"description": "The COS id of an already existing COS instance. Only required if 'use_existing_cos = true'",
6060
"pos": {
6161
"filename": "variables.tf",
62-
"line": 135
62+
"line": 147
6363
}
6464
},
6565
"force_delete_storage": {
@@ -73,7 +73,7 @@
7373
],
7474
"pos": {
7575
"filename": "variables.tf",
76-
"line": 117
76+
"line": 129
7777
}
7878
},
7979
"ibmcloud_api_key": {
@@ -107,7 +107,7 @@
107107
"description": "Use to attach a Key Protect instance to the cluster",
108108
"pos": {
109109
"filename": "variables.tf",
110-
"line": 141
110+
"line": 153
111111
}
112112
},
113113
"ocp_entitlement": {
@@ -121,7 +121,7 @@
121121
],
122122
"pos": {
123123
"filename": "variables.tf",
124-
"line": 111
124+
"line": 123
125125
}
126126
},
127127
"ocp_version": {
@@ -198,7 +198,7 @@
198198
],
199199
"pos": {
200200
"filename": "variables.tf",
201-
"line": 129
201+
"line": 141
202202
}
203203
},
204204
"vpc_id": {
@@ -214,7 +214,7 @@
214214
],
215215
"pos": {
216216
"filename": "variables.tf",
217-
"line": 152
217+
"line": 164
218218
},
219219
"immutable": true
220220
},

variables.tf

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,18 @@ variable "ocp_version" {
8888
type = string
8989
description = "The version of the OpenShift cluster that should be provisioned (format 4.x). This is only used during initial cluster provisioning, but ignored for future updates. If no value is passed, or the string 'latest' is passed, the current latest OCP version will be used."
9090
default = null
91+
92+
validation {
93+
condition = anytrue([
94+
var.ocp_version == null,
95+
var.ocp_version == "latest",
96+
var.ocp_version == "4.9",
97+
var.ocp_version == "4.10",
98+
var.ocp_version == "4.11",
99+
var.ocp_version == "4.12",
100+
])
101+
error_message = "The specified ocp_version is not of the valid versions."
102+
}
91103
}
92104

93105
variable "cluster_ready_when" {

0 commit comments

Comments
 (0)