The flagsmith.annotations helper combines common.annotations with a resource's own annotations by printing both blocks one after the other. When the same key exists in both, the rendered output contains that key twice:
annotations:
company.io/owner: platform # from common.annotations
company.io/owner: migrations-team # from the resource
Duplicate keys are invalid YAML. Kubernetes and lenient parsers keep the last one, so applies usually work — but strict tools (kubeconform --strict, kubectl --strict, ArgoCD) reject it, and the manifest is misleading to read.
This affects every resource using the helper with the customAnnotations / commonValues form — services, ingresses, gateways.
Suggested fix
Merge the two maps into one before rendering (resource-specific key wins), instead of concatenating. A fresh-dict merge avoids mutating values:
merge (dict) $resourceAnnotations $commonAnnotations
How to reproduce
Set the same annotation key in both common.annotations and a resource's annotations, run helm template, observe the duplicate key.
Discovered while reviewing #542.
The
flagsmith.annotationshelper combinescommon.annotationswith a resource's own annotations by printing both blocks one after the other. When the same key exists in both, the rendered output contains that key twice:Duplicate keys are invalid YAML. Kubernetes and lenient parsers keep the last one, so applies usually work — but strict tools (
kubeconform --strict,kubectl --strict, ArgoCD) reject it, and the manifest is misleading to read.This affects every resource using the helper with the
customAnnotations/commonValuesform — services, ingresses, gateways.Suggested fix
Merge the two maps into one before rendering (resource-specific key wins), instead of concatenating. A fresh-dict merge avoids mutating values:
How to reproduce
Set the same annotation key in both
common.annotationsand a resource'sannotations, runhelm template, observe the duplicate key.Discovered while reviewing #542.