Skip to content

elbv2: controller removes targetGroupRef upon sync #2652

@blowfishpro

Description

@blowfishpro

Describe the bug

When load balancer rule actions point to a target group via targetGroupRef, the controller will successfully resolve the reference but then remove the targetGroupRef from the spec, causing drift when using diffing tools or GitOps workflows.

Looks very similar to #2361 which references ECS but is not tagged with a specific service, feel free to close this if you'd rather keep everything under that one issue.

Watching the object diffs it looks like the resource briefly gets the ACK.ReferencesResolved=True condition but then it gets removed immediately.

I tried both spec.actions[].targetGroupRef and spec.actions[].forwardConfig.targetGroups[].targetGroupRef and see the same behavior.

Steps to reproduce

  • Create a load balancer Rule that references a target group via spec.actions[].targetGroupRef and spec.actions[].forwardConfig.targetGroups[].targetGroupRef
  • Let it get reconciled
  • Look at the state of the API object

Expected outcome

targetGroupRef should not be removed. Ideally user-supplied fields in the resource spec should not be modified by the controller.

Environment

  • Kubernetes version: 1.32
  • Using EKS yes
  • AWS service targeted: ELBv2
  • Controller version: 1.1.2

Metadata

Metadata

Assignees

Labels

kind/bugCategorizes issue or PR as related to a bug.service/elbv2Indicates issues or PRs that are related to elbv2-controller.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions