Skip to content

SRV records cannot be created by the cloudflare provider #4751

Closed as not planned
@starcraft66

Description

@starcraft66

What happened: I tried to create and SRV record with a DNSEndpoint CRD, using the cloudflare provider and this failed with a validation error from cloudflare's API as seen in the debug logs of external-dns.

What you expected to happen: The SRV record is created successfully.

How to reproduce it (as minimally and precisely as possible):

Anything else we need to know?: Cloudflare's API wants the SRV record to be created using structured data fields for all of the target's parameters and external-dns just tries to jam the raw resulting string into the create record API which is not how you create SRV records on cloudflare. The fix looks pretty obvious, the cloudflare provider's logic needs to be updated in order to support a special case to structure the data if we are creating an SRV record.

Unfortunately, the DNSEndpoint CRD is overly-simple and does not support describing this data in a structured way in the CRD itself so I suggest just doing the minimal amount of work and splitting the string on spaces if the record type is SRV to construct the structured fields and hope the data is valid-ish.

Ref: https://github.com/cloudflare/cloudflare-go/blob/v0.104.0/dns.go#L184

Environment:

  • External-DNS version (use external-dns --version): v0.15.0
  • DNS provider: cloudflare

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategorizes issue or PR as related to a bug.lifecycle/rottenDenotes an issue or PR that has aged beyond stale and will be auto-closed.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions