From e2469642b480da986af9052c8d0ac066d6c7e7b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leon=20Steinh=C3=A4user?= <42437185+leonsteinhaeuser@users.noreply.github.com> Date: Thu, 15 Aug 2024 16:01:13 +0200 Subject: [PATCH] chore!: change namespace overwrite behavior (#22) Signed-off-by: leonsteinhaeuser --- main.tf | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/main.tf b/main.tf index 948532f..bc1cc72 100644 --- a/main.tf +++ b/main.tf @@ -132,14 +132,20 @@ resource "argocd_application_set" "this" { destination { name = "{{ if (eq ${local.cluster_identifier} \"general-purpose\") }}in-cluster{{ else }}{{ ${local.cluster_identifier} }}{{ end }}" - // if the target_namespace_overwrite is not empty, then we want to use it as the namespace - // (e.g. ingress-controllers (assuming "ingress-controllers" is the target_namespace_overwrite)) - // otherwise we check if the configuration provided by the developer has a namespace_overwrite - // if the namespace_overwrite is not set, then we use the namespace based on the project name and git folder name - // (e.g. background-staging (assuming "background" is the project and "staging" the folder name)) - // otherwise we use the namespace_overwrite provided by the developer - // (e.g. background-staging-v2 (assuming "background" is the project and "staging-v2" the namespace_overwrite)) - namespace = var.target_namespace_overwrite != "" ? var.target_namespace_overwrite : "{{ if not .namespace_overwrite }}${var.project_name}-${local.resource_name}{{ else }}{{ .namespace_overwrite }}{{ end }}" + // if the namespace_overwrite in the values file is not null, then we want to use that value + // Otherwise, if the target_namespace_overwrite terraform variable is not null, then we want to use that value + // Otherwise, we automatically generate the namespace based on the project name and the resource name + namespace = <