From 6fd4f483e46f47ff39a24ea592bfc4c79bc36730 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gon=C3=A7alo=20Heleno?= Date: Thu, 20 Jul 2023 08:08:16 +0200 Subject: [PATCH] fix: readd support to deactivate auto-sync which was broken by #74 --- main.tf | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/main.tf b/main.tf index 7b525f47..dbc87693 100644 --- a/main.tf +++ b/main.tf @@ -119,10 +119,13 @@ resource "argocd_application" "this" { } sync_policy { - automated { - prune = var.app_autosync.prune - self_heal = var.app_autosync.self_heal - allow_empty = var.app_autosync.allow_empty + dynamic "automated" { + for_each = toset(var.app_autosync == { "allow_empty" = tobool(null), "prune" = tobool(null), "self_heal" = tobool(null) } ? [] : [var.app_autosync]) + content { + prune = automated.value.prune + self_heal = automated.value.self_heal + allow_empty = automated.value.allow_empty + } } retry {