fix: use correct ExternalSecret CRD name for force-sync annotation

The force-sync pre-filled the ExternalSecret object name with the
Kubernetes secret name (e.g. job-apply-common-secrets), but the
kubectl annotate command must target the ExternalSecret CRD object
(e.g. job-apply). Added external_secret_name_template config option
with fallback to k8s_secret_name_template.
This commit is contained in:
2026-09-16 11:49:35 +02:00
parent 205f8906df
commit 720064454b
4 changed files with 64 additions and 3 deletions
+8
View File
@@ -42,6 +42,14 @@ secret_name_template: "tf-{namespace}-{env}-secrets"
# Available placeholders: {namespace}.
k8s_secret_name_template: "{namespace}-common-secrets"
# Builds the ExternalSecret CRD object name to annotate when a force-sync
# is requested. This is often different from the Kubernetes secret name
# because the ExternalSecret CRD and the resulting Secret are separate
# objects (e.g. ExternalSecret "job-apply" produces Secret
# "job-apply-common-secrets"). Falls back to k8s_secret_name_template
# if omitted. Available placeholders: {namespace}.
external_secret_name_template: "{namespace}"
# Builds the actual kubectl context name/ARN from region, account ID, env,
# and context. Available placeholders: {region}, {account_id}, {env},
# {context}. Adjust the literal parts ("tf-", "-1", cluster naming, ARN