From 8d77d3a89ea7829b88832fe989d298d2a15ebacd Mon Sep 17 00:00:00 2001 From: Hector Machin Date: Mon, 26 Feb 2024 10:37:55 -0500 Subject: [PATCH 1/4] Fixing for_each for var.swoop_sa_iam_role --- modules/swoop/swoop-bundle/main.tf | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/swoop/swoop-bundle/main.tf b/modules/swoop/swoop-bundle/main.tf index 8827a78..368c846 100644 --- a/modules/swoop/swoop-bundle/main.tf +++ b/modules/swoop/swoop-bundle/main.tf @@ -179,7 +179,8 @@ resource "helm_release" "swoop_bundle" { } dynamic "set" { - for_each = var.swoop_sa_iam_role != "" ? [var.swoop_sa_iam_role] : [] + for_each = { for k, v in [var.swoop_sa_iam_role] : k => + v if var.swoop_sa_iam_role != "" } content { name = "swoop-caboose.argo-workflows.workflow.serviceAccount.annotations.eks\\.amazonaws\\.com/role-arn" value = set.value @@ -231,7 +232,8 @@ resource "helm_release" "swoop_bundle" { } dynamic "set" { - for_each = var.swoop_sa_iam_role != "" ? [var.swoop_sa_iam_role] : [] + for_each = { for k, v in [var.swoop_sa_iam_role] : k => + v if var.swoop_sa_iam_role != "" } content { name = "swoop-conductor.argo-workflows.workflow.serviceAccount.annotations.eks\\.amazonaws\\.com/role-arn" value = set.value From 4fc3ff017f3a6bfbcdbcacca1bb1ba31a9af3b19 Mon Sep 17 00:00:00 2001 From: Hector Machin Date: Mon, 26 Feb 2024 10:45:27 -0500 Subject: [PATCH 2/4] Fixing for_each for var.swoop_sa_iam_role --- modules/swoop/swoop-bundle/main.tf | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/modules/swoop/swoop-bundle/main.tf b/modules/swoop/swoop-bundle/main.tf index 368c846..ac47a52 100644 --- a/modules/swoop/swoop-bundle/main.tf +++ b/modules/swoop/swoop-bundle/main.tf @@ -179,8 +179,7 @@ resource "helm_release" "swoop_bundle" { } dynamic "set" { - for_each = { for k, v in [var.swoop_sa_iam_role] : k => - v if var.swoop_sa_iam_role != "" } + for_each = var.swoop_sa_iam_role != "" ? toset([var.swoop_sa_iam_role]) : toset([]) content { name = "swoop-caboose.argo-workflows.workflow.serviceAccount.annotations.eks\\.amazonaws\\.com/role-arn" value = set.value @@ -232,8 +231,7 @@ resource "helm_release" "swoop_bundle" { } dynamic "set" { - for_each = { for k, v in [var.swoop_sa_iam_role] : k => - v if var.swoop_sa_iam_role != "" } + for_each = var.swoop_sa_iam_role != "" ? toset([var.swoop_sa_iam_role]) : toset([]) content { name = "swoop-conductor.argo-workflows.workflow.serviceAccount.annotations.eks\\.amazonaws\\.com/role-arn" value = set.value From 017cb5dfb211c3db6057328120fdff0bf76e00df Mon Sep 17 00:00:00 2001 From: Hector Machin Date: Mon, 26 Feb 2024 10:55:58 -0500 Subject: [PATCH 3/4] Fixing for_each for var.swoop_sa_iam_role --- modules/swoop/swoop-bundle/main.tf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/swoop/swoop-bundle/main.tf b/modules/swoop/swoop-bundle/main.tf index ac47a52..6c8cff1 100644 --- a/modules/swoop/swoop-bundle/main.tf +++ b/modules/swoop/swoop-bundle/main.tf @@ -179,7 +179,7 @@ resource "helm_release" "swoop_bundle" { } dynamic "set" { - for_each = var.swoop_sa_iam_role != "" ? toset([var.swoop_sa_iam_role]) : toset([]) + for_each = nonsensitive(var.swoop_sa_iam_role) != "" ? [nonsensitive(var.swoop_sa_iam_role)] : [] content { name = "swoop-caboose.argo-workflows.workflow.serviceAccount.annotations.eks\\.amazonaws\\.com/role-arn" value = set.value @@ -231,7 +231,7 @@ resource "helm_release" "swoop_bundle" { } dynamic "set" { - for_each = var.swoop_sa_iam_role != "" ? toset([var.swoop_sa_iam_role]) : toset([]) + for_each = nonsensitive(var.swoop_sa_iam_role) != "" ? [nonsensitive(var.swoop_sa_iam_role)] : [] content { name = "swoop-conductor.argo-workflows.workflow.serviceAccount.annotations.eks\\.amazonaws\\.com/role-arn" value = set.value From a9c787e9a00236c0f04b6d03dbc3cddfed4119f7 Mon Sep 17 00:00:00 2001 From: Hector Machin Date: Mon, 26 Feb 2024 18:26:53 -0500 Subject: [PATCH 4/4] Fixing testkube tests --- .github/workflows/testkube.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/testkube.yml b/.github/workflows/testkube.yml index 01790c3..53c9351 100644 --- a/.github/workflows/testkube.yml +++ b/.github/workflows/testkube.yml @@ -86,12 +86,9 @@ jobs: kubectl exec -it --namespace=db svc/postgres -- /bin/sh -c "swoop-db up" kubectl exec -it --namespace=db svc/postgres -- /bin/sh -c "swoop-db load-fixture base_01" + - uses: kubeshop/setup-testkube@v1 - name: Installing Testkube run: | - wget -qO - https://repo.testkube.io/key.pub | sudo apt-key add - - echo "deb https://repo.testkube.io/linux linux main" | sudo tee -a /etc/apt/sources.list - sudo apt-get update - sudo apt-get install -y testkube kubectl testkube install --no-confirm kubectl wait --for=condition=ready --timeout=30m pod -n testkube -l app.kubernetes.io/instance=testkube kubectl port-forward -n testkube svc/testkube-api-server 8088:8088 &