Skip to content

Changing recordSet name in route53 controller creates new record without deleting the old one, leading to dangling records #2202

Open
@bugbuilder

Description

@bugbuilder

Describe the bug
When changing the name of a recordsets.route53.services.k8s.aws to update its DNS record, the controller creates a new record but does not delete the previous one. This behavior results in dangling records, which can lead to stale DNS entries and potential misconfigurations.

Steps to reproduce

  1. Create a recordsets.route53.services.k8s.aws resource, for example:
apiVersion: route53.services.k8s.aws/v1alpha1
kind: RecordSet
metadata:
  name: test-http-default
  namespace: test
spec:
  aliasTarget:
    dnsName: ------.cloudfront.net
    evaluateTargetHealth: false
    hostedZoneID: Z2FDTNDATAQYW2
  hostedZoneID: Z-------
  name: cato
  recordType: A

  1. After the record is created, verify that the DNS record cato exists in the Route53 hosted zone.
  2. Now, edit the name field in the spec to change it from cato to cheto:
apiVersion: route53.services.k8s.aws/v1alpha1
kind: RecordSet
metadata:
  name: test-http-default
  namespace: test
spec:
  aliasTarget:
    dnsName: ------.cloudfront.net
    evaluateTargetHealth: false
    hostedZoneID: Z2FDTNDATAQYW2
  hostedZoneID: Z-------
  name: cheto
  recordType: A

Expected outcome
The original record (cato) should be deleted, and a new record (cheto) should be created.

Environment

  • Kubernetes version v1.30.4-eks-a737599
  • AWS service Route-53

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions