Skip to content

Commit d517dcc

Browse files
authored
fix: update the addon depends_on (#211)
1 parent a824e65 commit d517dcc

File tree

4 files changed

+24
-19
lines changed

4 files changed

+24
-19
lines changed

examples/standard/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ locals {
6363
worker_pools = [
6464
{
6565
subnet_prefix = "default"
66-
pool_name = "default" # ibm_container_vpc_cluster automatically names standard pool "standard" (See https://github.com/IBM-Cloud/terraform-provider-ibm/issues/2849)
66+
pool_name = "default" # ibm_container_vpc_cluster automatically names standard pool "default" (See https://github.com/IBM-Cloud/terraform-provider-ibm/issues/2849)
6767
machine_type = "bx2.4x16"
6868
workers_per_zone = 2
6969
labels = {}

main.tf

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,10 @@ resource "null_resource" "confirm_network_healthy" {
345345

346346
count = var.verify_worker_network_readiness ? 1 : 0
347347

348-
depends_on = [ibm_container_vpc_worker_pool.pool, ibm_container_vpc_worker_pool.autoscaling_pool]
348+
# Worker pool creation can start before the 'ibm_container_vpc_cluster' completes since there is no explicit
349+
# depends_on in 'ibm_container_vpc_worker_pool', just an implicit depends_on on the cluster ID. Cluster ID can exist before
350+
# 'ibm_container_vpc_cluster' completes, so hence need to add explicit depends on against 'ibm_container_vpc_cluster' here.
351+
depends_on = [ibm_container_vpc_cluster.cluster, ibm_container_vpc_worker_pool.pool, ibm_container_vpc_worker_pool.autoscaling_pool]
349352

350353
provisioner "local-exec" {
351354
command = "${path.module}/scripts/confirm_network_healthy.sh"
@@ -358,7 +361,11 @@ resource "null_resource" "confirm_network_healthy" {
358361

359362

360363
resource "ibm_container_addons" "addons" {
361-
depends_on = [ibm_container_vpc_worker_pool.pool, ibm_container_vpc_worker_pool.autoscaling_pool, null_resource.confirm_network_healthy]
364+
365+
# Worker pool creation can start before the 'ibm_container_vpc_cluster' completes since there is no explicit
366+
# depends_on in 'ibm_container_vpc_worker_pool', just an implicit depends_on on the cluster ID. Cluster ID can exist before
367+
# 'ibm_container_vpc_cluster' completes, so hence need to add explicit depends on against 'ibm_container_vpc_cluster' here.
368+
depends_on = [ibm_container_vpc_cluster.cluster, ibm_container_vpc_worker_pool.pool, ibm_container_vpc_worker_pool.autoscaling_pool, null_resource.confirm_network_healthy]
362369

363370
cluster = local.cluster_id
364371
resource_group_id = var.resource_group_id

module-metadata.json

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
],
1414
"pos": {
1515
"filename": "variables.tf",
16-
"line": 178
16+
"line": 176
1717
},
1818
"min_length": 1,
1919
"max_length": 128,
@@ -29,7 +29,7 @@
2929
"description": "List of all addons supported by the ocp cluster.",
3030
"pos": {
3131
"filename": "variables.tf",
32-
"line": 203
32+
"line": 201
3333
}
3434
},
3535
"cluster_name": {
@@ -67,7 +67,7 @@
6767
"description": "Name of the COS instance to provision. New instance only provisioned if `use_existing_cos = false`. Default: `\u003ccluster_name\u003e_cos`",
6868
"pos": {
6969
"filename": "variables.tf",
70-
"line": 150
70+
"line": 148
7171
}
7272
},
7373
"disable_public_endpoint": {
@@ -82,7 +82,7 @@
8282
],
8383
"pos": {
8484
"filename": "variables.tf",
85-
"line": 132
85+
"line": 130
8686
}
8787
},
8888
"existing_cos_id": {
@@ -91,7 +91,7 @@
9191
"description": "The COS id of an already existing COS instance. Only required if 'use_existing_cos = true'",
9292
"pos": {
9393
"filename": "variables.tf",
94-
"line": 162
94+
"line": 160
9595
}
9696
},
9797
"force_delete_storage": {
@@ -105,7 +105,7 @@
105105
],
106106
"pos": {
107107
"filename": "variables.tf",
108-
"line": 144
108+
"line": 142
109109
}
110110
},
111111
"ibmcloud_api_key": {
@@ -144,7 +144,7 @@
144144
"description": "Use to attach a Key Protect instance to the cluster",
145145
"pos": {
146146
"filename": "variables.tf",
147-
"line": 168
147+
"line": 166
148148
}
149149
},
150150
"ocp_entitlement": {
@@ -158,7 +158,7 @@
158158
],
159159
"pos": {
160160
"filename": "variables.tf",
161-
"line": 138
161+
"line": 136
162162
}
163163
},
164164
"ocp_version": {
@@ -238,7 +238,7 @@
238238
],
239239
"pos": {
240240
"filename": "variables.tf",
241-
"line": 156
241+
"line": 154
242242
}
243243
},
244244
"verify_worker_network_readiness": {
@@ -252,7 +252,7 @@
252252
],
253253
"pos": {
254254
"filename": "variables.tf",
255-
"line": 197
255+
"line": 195
256256
}
257257
},
258258
"vpc_id": {
@@ -268,7 +268,7 @@
268268
],
269269
"pos": {
270270
"filename": "variables.tf",
271-
"line": 192
271+
"line": 190
272272
},
273273
"immutable": true
274274
},
@@ -444,7 +444,7 @@
444444
},
445445
"pos": {
446446
"filename": "main.tf",
447-
"line": 360
447+
"line": 363
448448
}
449449
},
450450
"ibm_container_vpc_cluster.autoscaling_cluster": {
@@ -570,7 +570,7 @@
570570
},
571571
"pos": {
572572
"filename": "main.tf",
573-
"line": 397
573+
"line": 404
574574
}
575575
},
576576
"null_resource.confirm_network_healthy": {
@@ -609,7 +609,7 @@
609609
},
610610
"pos": {
611611
"filename": "main.tf",
612-
"line": 379
612+
"line": 386
613613
}
614614
}
615615
},

variables.tf

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,6 @@ variable "cluster_ready_when" {
121121
type = string
122122
description = "The cluster is ready when one of the following: MasterNodeReady (not recommended), OneWorkerNodeReady, Normal, IngressReady"
123123
default = "IngressReady"
124-
# Set to "Normal" once provider fixes https://github.com/IBM-Cloud/terraform-provider-ibm/issues/4214
125-
# default = "Normal"
126124

127125
validation {
128126
condition = contains(["MasterNodeReady", "OneWorkerNodeReady", "Normal", "IngressReady"], var.cluster_ready_when)

0 commit comments

Comments
 (0)