Skip to content

Fix remaining empty annotations: keys in chart templates#814

Merged
JorTurFer merged 2 commits into
kedacore:mainfrom
BEvgeniyS:bevgeniys/remove-blank-annotation-keys
Feb 15, 2026
Merged

Fix remaining empty annotations: keys in chart templates#814
JorTurFer merged 2 commits into
kedacore:mainfrom
BEvgeniyS:bevgeniys/remove-blank-annotation-keys

Conversation

@BEvgeniyS

@BEvgeniyS BEvgeniyS commented Feb 9, 2026

Copy link
Copy Markdown
Contributor

Fix remaining empty annotations: keys in chart templates

Follow-up to #486 which fixed empty annotation blocks
across almost everywhere, but we still have 3 more:

  • webhooks/service.yaml: the outer conditional included
    prometheus.webhooks.enabled without the
    not serviceMonitor.enabled guard that manager/service.yaml and
    metrics-server/service.yaml both have. When prometheus + serviceMonitor
    are both enabled (prometheus.io/* annotations aren't needed), the
    annotations block renders empty.

  • metrics-server/serviceaccount.yaml: annotations: rendered
    unconditionally, no outer guard at all.

  • webhooks/serviceaccount.yaml: same as above.

Empty annotations: keys cause issues with ArgoCD's ServerSideApply —
the apply controller claims ownership of the annotations field, and then
any annotation injected by external controllers (e.g. GKE NEG
controller adding cloud.google.com/neg) is treated as drift, keeping
the app permanently OutOfSync.

How to reproduce

# webhooks service — needs prometheus + serviceMonitor both enabled
helm template keda keda \
  --set prometheus.webhooks.enabled=true \
  --set prometheus.webhooks.serviceMonitor.enabled=true \
  -s templates/webhooks/service.yaml | grep -C1 'annotations:$'

# serviceaccounts — empty annotations with default values
helm template keda keda -s templates/metrics-server/serviceaccount.yaml | grep -C1 'annotations:$'
helm template keda keda -s templates/webhooks/serviceaccount.yaml | grep -C1 'annotations:$'

Checklist

  • I have verified that my change is according to the deprecations & breaking changes policy
  • Commits are signed with Developer Certificate of Origin (DCO - learn more)
  • README is updated with new configuration values (if applicable) learn more
  • A PR is opened to update KEDA core (repo) (if applicable, ie. when deployment manifests are modified)

Fixes #397 (although that particular file is already fixed, so should probably be just closed)

Signed-off-by: Eugene Babichev <[email protected]>
@BEvgeniyS BEvgeniyS requested a review from a team as a code owner February 9, 2026 01:00
@BEvgeniyS

Copy link
Copy Markdown
Contributor Author

The PR title is wrong 🤦, but I can't update it

@JorTurFer JorTurFer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix!

@BEvgeniyS BEvgeniyS changed the title remove unused variables Fix remaining empty annotations: keys in chart templates Feb 15, 2026
@JorTurFer JorTurFer merged commit 446ad91 into kedacore:main Feb 15, 2026
51 of 53 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Empty annotations in APIService cause diffs in GitOps tooling

2 participants