Skip to content

Commit

Permalink
fix: sensitive leaders problem
Browse files Browse the repository at this point in the history
  • Loading branch information
KoLiBer committed Mar 6, 2024
1 parent 2027bdf commit d3a3067
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ module "agents" {
module "addons" {
source = "cktf/script/module"
version = "1.1.0"
for_each = { for key, val in var.addons : key => val if local.leaders != {} }
for_each = { for key, val in var.addons : key => val if length(keys(local.leaders)) > 0 }
depends_on = [module.leader]

connection = try(values(local.leaders)[0].connection, null)
Expand All @@ -100,7 +100,7 @@ module "addons" {
}

resource "ssh_sensitive_resource" "kubeconfig" {
count = (local.leaders != {}) ? 1 : 0
count = (length(keys(local.leaders)) > 0) ? 1 : 0
depends_on = [module.leader]

host = try(values(local.leaders)[0].connection.host, null)
Expand Down

0 comments on commit d3a3067

Please sign in to comment.