. ArgoCD based gotemplating is supported. e.g. {{ index .path.segments 2 }} | `string` | `null` | no |
+| [env\_context\_annotations](#input\_env\_context\_annotations) | A map of annotations that are rendered via go template. Available variables are cluster, resourceName and applicationName. You can access the variables using go templating. e.g. {{ $cluster }}, {{ $resourceName }}, {{ $applicationName }} | `map(string)` | `{}` | no |
| [generator](#input\_generator) | The generator configuration. Only one generator can be used at a time. | object({
git = optional(object({
repo_url = string
revision = string
files = optional(list(string))
directories = optional(list(object({
path = string
exclude = bool
})))
}))
pull_request = optional(list(object({
requeue_after_seconds = number
repo = string
labels = list(string)
})))
})
| n/a | yes |
| [generator\_segment\_index\_overwrite](#input\_generator\_segment\_index\_overwrite) | Optional generator setting to override the index path segment during path selection. This option should only be set if generator.git.directories is used. Otherwise it should be left empty as it may affect the behavior. If this option is set in combination with generator.git.directories and your repository contains the cluster folder name in its root directory, this option should be set to 0. In all other cases, this option should reflect the index segment level to the directory corresponding to the cluster name. | `number` | `null` | no |
| [ignore\_difference](#input\_ignore\_difference) | A list of object kinds to ignore during the diff process. This is useful if you want to ignore certain differences between the application set and the cluster. e.g. if you want to ignore differences in the namespace labels. | list(object({
group = optional(string)
jq_path_expressions = optional(list(string))
json_pointers = optional(list(string))
kind = optional(string)
name = optional(string)
namespace = optional(string)
}))
| `null` | no |
diff --git a/examples/main.tf b/examples/main.tf
index 3721cdd..4de597e 100644
--- a/examples/main.tf
+++ b/examples/main.tf
@@ -34,4 +34,17 @@ module "example" {
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" = < "{{ $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(
var.labels,
diff --git a/variables.tf b/variables.tf
index 52c1069..1d4d9c7 100644
--- a/variables.tf
+++ b/variables.tf
@@ -168,3 +168,9 @@ variable "ignore_difference" {
description = "A list of object kinds to ignore during the diff process. This is useful if you want to ignore certain differences between the application set and the cluster. e.g. if you want to ignore differences in the namespace labels."
default = null
}
+
+variable "env_context_annotations" {
+ type = map(string)
+ description = "A map of annotations that are rendered via go template. Available variables are cluster, resourceName and applicationName. You can access the variables using go templating. e.g. {{ $cluster }}, {{ $resourceName }}, {{ $applicationName }}"
+ default = {}
+}