Skip to content

[ec2-controller] DHCPOptions: changing the VPC and the tags together reverts the tags #3167

Open

Description

@gobos12

Describe the bug

Changing the VPC and the tags in one update reverts the tags, in the CR and in AWS. Found by dhcp-options, at check-update-1.

Observed: the controller attaches the VPC and syncs the new tags, then writes the old tags back into the CR's spec. The next reconcile puts them back in AWS, and the CR reports Synced:

gen 2: Spec.Tags desired [updatedtagkey], latest [initialtagkey]; Spec.VPC desired [vpc-...], latest nil
gen 3: Spec.Tags desired [initialtagkey], latest [updatedtagkey]

Cause: customUpdateDHCPOptions sets updated from sdkFind after syncVPCs and before tags.Sync, and returns it.

Steps to reproduce

Create a DHCPOptions with tags and no VPC. In one update, add vpcRefs and change the tags.

Expected outcome

The new tags stay, in the CR and in AWS.

Environment

  • Kubernetes version: 1.35
  • Using EKS (yes/no), if so version? Yes, 1.35
  • AWS service targeted (S3, RDS, etc.): EC2
  • ec2-controller v1.24.0, ACK runtime v0.68.0, us-west-2

Activity

  1. github-actions commented on Nov 12, 2026

    @github-actions

    Hello @gobos12 👋 Thank you for opening an issue in ACK! A maintainer will triage this issue soon.

    We encourage community contributions, so if you're interested in tackling this yourself or suggesting a solution, please check out our Contribution and Code of Conduct guidelines.

    You can find more information about ACK on our website.

  2. added
    kind/bugCategorizes issue or PR as related to a bug.
    service/ec2Indicates issues or PRs that are related to ec2-controller.
    kind/tag-issueIssues or PRs related to controller tagging
    on Nov 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategorizes issue or PR as related to a bug.kind/tag-issueIssues or PRs related to controller taggingservice/ec2Indicates issues or PRs that are related to ec2-controller.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions