Skip to content
This repository was archived by the owner on Aug 12, 2024. It is now read-only.

Commit 8b54173

Browse files
author
Sean Sundberg
committed
Sets login flag if public endpoints are enabled (#33)
Signed-off-by: Sean Sundberg <[email protected]>
1 parent 4ee314e commit 8b54173

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

main.tf

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ locals {
5151
"kms",
5252
"hs-crypto"
5353
]
54-
cluster_config = var.login ? data.ibm_container_cluster_config.cluster[0].config_file_path : ""
54+
login = var.login ? var.login : !var.disable_public_endpoint
55+
cluster_config = local.login ? data.ibm_container_cluster_config.cluster[0].config_file_path : ""
5556
}
5657

5758
resource null_resource create_dirs {
@@ -204,7 +205,7 @@ resource "null_resource" "list_tmp" {
204205

205206

206207
data ibm_container_cluster_config cluster_admin {
207-
count = var.login ? 1 : 0
208+
count = local.login ? 1 : 0
208209
depends_on = [data.ibm_container_vpc_cluster.config, null_resource.list_tmp]
209210

210211
cluster_name_id = local.cluster_name
@@ -214,7 +215,7 @@ data ibm_container_cluster_config cluster_admin {
214215
}
215216

216217
data ibm_container_cluster_config cluster {
217-
count = var.login ? 1 : 0
218+
count = local.login ? 1 : 0
218219
depends_on = [
219220
data.ibm_container_vpc_cluster.config,
220221
null_resource.list_tmp,
@@ -227,7 +228,7 @@ data ibm_container_cluster_config cluster {
227228
}
228229

229230
resource null_resource setup_kube_config {
230-
count = var.login ? 1 : 0
231+
count = local.login ? 1 : 0
231232
depends_on = [null_resource.create_dirs, data.ibm_container_cluster_config.cluster]
232233

233234
provisioner "local-exec" {

0 commit comments

Comments
 (0)