Skip to content

Conversation

@andsens
Copy link

@andsens andsens commented Nov 26, 2025

OK, soooo... I've made a "few" changes

First off: It works! :-)

This is quite a rewrite mainly motivated by relying on the external-dns webhook library instead of the code that was in internal/externaldns. That alone removes a whole bunch of code (and likely brings with it quite a few bugfixes just by running external-dns v0.19.0).

I have updated libdns from v0.2.3 to v1.1.1. That bump introduced a major API change, which not all providers support yet, so I've had to remove those (I also had to add a small go mod replacement for the INWX provider to fix an API inconsistency merged to upstream in ab63b136).
In total 18 out of the 42 providers are now commented out in go.mod.

I was able to reproduce the issue you mentioned regarding labels. As far as I understand, the weight and priority of an e.g. SRV record is part of the target field. So I don't really see the point of managing those separately. Additionally, the ID field was not used for anything, so I remove that as well. This all means no more provider specific labels.
In conclusion the whole issue is gone because I simply nuked the code from orbit :-)

The linting rules were really hard to manage after I migrated to golangci-lint v2, so I just reverted it to the default config (I think that's a better approach anyways, standard setups are always easier to contribute to).

I replaced zerolog with slog. You had a commit yourself where you reduced external dependencies. Seeing how slog can do the same kind of structure logging it seemed like a fair replacement to reduce deps.

gorelease works really well if you use it fully. The half-way approach I introduced in #1 where Github actions invokes gorelease, it outputs the binaries and docker/build-push-action builds the images introduces more workaround code than it saves. So I reverted to standard go build and use debug.ReadBuildInfo() to display the version (go build automatically embeds VCS info into the binary when available). This has the added benefit of being standard tooling that everybody knows.

All in all around 320 lines of non-generated code have been obsoleted.

I'm running this in my cluster right now, and it looks to be working well! I'll report back once I have loaded it with a bit more data.

p.s.: Have you considered asking the external-dns team to take over this project so it has some more visibility? They have stopped accepting PRs for new providers and recommend using webhooks. If they embraced your approach people could maybe focus on implementing things on libdns, which would benefit way more projects than just external-dns.

@andsens
Copy link
Author

andsens commented Dec 4, 2025

So I don't really see the point of managing those separately.

Scratch that. Vendors like INWX rather infuriatingly separate out the preference/priority field in their API. However, there is no need to special case things: That is the job of the libdns provider, and it already does that: https://github.com/libdns/inwx/blob/ab63b13631a13a592aafaf3e04b327b38c7ac0bc/provider.go#L242-L249

So the only thing we need to do is call rr.Parse() when converting to libdns records so the provider has the correct fields filled out.

I also noticed that I only propagated the first target in the list, that is fixed now as well.

Please let me know if maintaining this with all my changes is too much. That'd be perfectly understandable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant