Skip to content

fix(rg-eks): merge duplicate annotations blocks in cniMetricsHelperPolicy - #862

Merged
allamand merged 1 commit into
release/v0.3.0-rc3from
fix/rg-eks-cni-metrics-policy-annotations
Sep 4, 2026
Merged

fix(rg-eks): merge duplicate annotations blocks in cniMetricsHelperPolicy#862
allamand merged 1 commit into
release/v0.3.0-rc3from
fix/rg-eks-cni-metrics-policy-annotations

Conversation

@allamand

@allamand allamand commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Problem

cniMetricsHelperPolicy resource in rg-eks.yaml had two separate annotations: blocks in the same metadata section, separated by ownerReferences:

metadata:
  annotations:
    services.k8s.aws/adoption-policy: adopt-or-create  # FIRST
    services.k8s.aws/adoption-fields: ...
  ownerReferences: ...
  annotations:                                          # SECOND - overwrites first!
    argocd.argoproj.io/tracking-id: ...
    services.k8s.aws/region: ...

YAML merge semantics mean the second block silently overwrites the first, so adoption-policy: adopt-or-create was never applied to the CR.

Consequence on reused accounts: ACK received a Policy CR without adoption annotation, failed with EntityAlreadyExists (policy from a previous run still present), never populated .status.ackResourceMetadata.arn, causing KRO to report:

cniMetricsHelperPolicy.status.ackResourceMetadata.arn: no such key: arn (data pending)

This caused task install to hang indefinitely at hub:wait-for-eks.

Consequence on fresh accounts: adopt-or-create has no effect on first install since the policy doesn't exist yet, but on any re-run the policy is orphaned.

Fix

Merged both annotation blocks into a single block with all four keys. One-line change.

Related

PR #835 (v0.3.0-rc3 teardown validation) — discovered during install testing on reused account kro-c1.

@allamand
allamand force-pushed the fix/rg-eks-cni-metrics-policy-annotations branch from 3d03274 to 96b8158 Compare September 4, 2026 06:22
…licy

The cniMetricsHelperPolicy resource template had two separate 'annotations:'
blocks in the same metadata section, with 'ownerReferences' between them:

  metadata:
    annotations:
      services.k8s.aws/adoption-policy: adopt-or-create  # FIRST (adoption)
      services.k8s.aws/adoption-fields: ...
    ownerReferences: ...
    annotations:                                          # SECOND (overwrites first!)
      argocd.argoproj.io/tracking-id: ...
      services.k8s.aws/region: ...

YAML merge semantics mean the second 'annotations:' block overwrites the first,
so the 'adopt-or-create' annotation was silently dropped. KRO created the
Policy CR without adoption-policy, causing ACK to fail with
'EntityAlreadyExists' when the policy already existed from a previous run
(reused account). This prevented KRO from getting the ARN, causing:
  'cniMetricsHelperPolicy.status.ackResourceMetadata.arn: no such key: arn'

Fix: merge both annotation blocks into a single block with all four keys.
The order is: adoption annotations first (so they're not accidentally removed
by future edits), then tracking and region annotations.
@allamand
allamand force-pushed the fix/rg-eks-cni-metrics-policy-annotations branch from 96b8158 to b52089d Compare September 4, 2026 06:26
@allamand
allamand merged commit 5cf2c94 into release/v0.3.0-rc3 Sep 4, 2026
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.

1 participant