Skip to content

Commit

Permalink
fix: new line and space in namespace destination block (#26)
Browse files Browse the repository at this point in the history
* fix: new line and space in namespace destination block

Signed-off-by: Leon Steinhäuser <[email protected]>

* chore(examples): add example with target_namespace_overwrite

Signed-off-by: leonsteinhaeuser <[email protected]>

---------

Signed-off-by: Leon Steinhäuser <[email protected]>
Signed-off-by: leonsteinhaeuser <[email protected]>
  • Loading branch information
leonsteinhaeuser authored Aug 26, 2024
1 parent dc5a1ba commit 145f534
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 14 deletions.
24 changes: 12 additions & 12 deletions examples/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

52 changes: 52 additions & 0 deletions examples/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,55 @@ develop
EOT
}
}

module "example_system" {
source = "../"

name = "example-system"
project_name = "example-system"
generator = {
git = {
repo_url = "https://github.com/urbanmedia/example-deployment.git"
revision = "main"
files = [
"argo/*/*/example-system.yaml"
]
}
}
target_namespace_overwrite = "example-system"
manifest_source = {
helm = {
chart = "example-system"
release_name = "example-system"
repo_url = "ghcr.io/urbanmedia/example-deployment"
target_revision = "1.1.16"
}
}
generator_segment_index_overwrite = 1
application_name_suffix = null
annotations = {
"argocd.argoproj.io/sync-wave" = "2",
}
sync_options = [
"Validate=false",
"ApplyOutOfSyncOnly=true",
]
sync_policy = {
prune = true
self_heal = true
allow_empty = true
}
env_context_annotations = {
"argocd-image-updater.argoproj.io/image-list" = "xyz=tagesspiegel/xyz"
"argocd-image-updater.argoproj.io/xyz.update-strategy" = "latest"
"argocd-image-updater.argoproj.io/xyz.allow-tags" = <<EOT
{{- if eq $cluster "staging" }}
regex:v[0-9]{1,}.[0-9]{1,}.[0-9]{1,}-rc.[0-9]{1,}
{{- else if eq $cluster "production" }}
regex:v[0-9]{1,}.[0-9]{1,}.[0-9]{1,}
{{- else }}
develop
{{- end }}"
EOT
}
}
4 changes: 2 additions & 2 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,9 @@ resource "argocd_application_set" "this" {
{{- .namespace_overwrite }}
{{- else }}
{{- if ne "${var.target_namespace_overwrite}" "" }}
${var.target_namespace_overwrite}
{{- print "${var.target_namespace_overwrite}" }}
{{- else }}
${var.project_name}-${local.resource_name}
{{- print "${var.project_name}-${local.resource_name}" }}
{{- end }}
{{- end -}}
EOT
Expand Down

0 comments on commit 145f534

Please sign in to comment.