-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Description
What happened:
- deployed external-dns on EKS
- added parameters --managed-record-types=NAPTR
- created a CRD with a record of type NAPTR
The NAPTR and TXT records are correctly created when they do not already exist.
On the next passes it again tries to create the records again and fails with the errors listed below.
time="2025-01-13T21:43:51Z" level=info msg="Desired change: CREATE REDACTED NAPTR" profile=default zoneID=/hostedzone/Z0XXXXXXXXXXXXXXXXXXX zoneName=xxxxxxxxx.xxx.
time="2025-01-13T21:43:51Z" level=info msg="Desired change: CREATE extdns-naptr-xxxxxxxxxxxxxxTXT" profile=default zoneID=/hostedzone/Z0XXXXXXXXXXXXXXXXXXX zoneName=xxxxxxxxxxxxxxx.
time="2025-01-13T21:43:51Z" level=error msg="Failure in zone xxxxxxxxxxxxxxx. when submitting change batch: InvalidChangeBatch: [Tried to create resource record set [name='xxxxxxxxxxxxxxx.', type='NAPTR'] but it already exists, Tried to create resource record set [name='extdns-naptr-xxxxxxxxxxxxxxx', type='TXT'] but it already exists]\n\tstatus code: 400, request id: xxxxxxxxxx-xxxxxx-xxxx-xxxx-xxxxxxxxxxxx" profile=default zoneID=/hostedzone/Z0XXXXXXXXXXXXXXXXXXX zoneName=xxxxxxxxxxxxxxxxx.
The created NAPTR record can't be removed by external-dns.
What you expected to happen:
Once the records exist they should not be created again.
How to reproduce it (as minimally and precisely as possible):
Enable NAPTR using the --managed-record-types argument and provider aws and add crd to sources
Create a CRD with a NAPTR record.
Anything else we need to know?:
Looking at the code of aws provider it seems that the NAPTR records are skipped because p.SupportedRecordType(r.Type) returns false when r.Type equals "NAPTR".
The provider will create the NAPTR record successfully if it not exists.
Because func (p *AWSProvider) records(ctx context.Context, zones map[string]*profiledZone) ([]*endpoint.Endpoint, error) totally skips the NAPTR records they can't be updated or deleted by external-dns
Environment:
- External-DNS version (use
external-dns --version):
v20240904-v0.15.0
- DNS provider:
aws
- Others: