Skip to content

Commit

Permalink
chore: improved env context annotations handling
Browse files Browse the repository at this point in the history
Signed-off-by: leonsteinhaeuser <[email protected]>
  • Loading branch information
leonsteinhaeuser committed Oct 27, 2023
1 parent 1e940de commit ecf2804
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,7 @@ resource "argocd_application_set" "this" {
"application-set" = var.name
},
{
for k, v in var.env_context_annotations : k => <<EOF
{{- $applicationName := "${var.name}" }}
{{- $resourceName := "${local.resource_name}" }}
{{- $cluster := "" }}{{ if eq (index .Path.Segments 1) "general-purpose" }}{{ $cluster = "in-cluster" }}{{ else }}{{ $cluster = (index .Path.Segments 1) }}{{ end }}${v}
EOF
for k, v in var.env_context_annotations : k => "{{ $applicationName := \"${var.name}\" }}{{ $resourceName := \"${local.resource_name}\" }}{{ $cluster := \"\" }}{{ if eq (index .Path.Segments 1) \"general-purpose\" }}{{ $cluster = \"in-cluster\" }}{{ else }}{{ $cluster = (index .Path.Segments 1) }}{{ end }}${v}"
}
)
labels = merge(
Expand Down

0 comments on commit ecf2804

Please sign in to comment.