Commit graph

16 commits

Author SHA1 Message Date
0a771772e3 Handle duplicate DNS records with upsert semantics
When Vultr's API returns "Duplicate records are not allowed" on
DomainRecord.Create, find the existing record by name+type and update
it instead of failing. This prevents ACME certificate issuance from
breaking when stale _acme-challenge TXT records survive a Caddy
restart.

Also fix record lookup in removeDNSRecord and updateDNSRecord to
match by name+type+data instead of name-only or data-only, avoiding
deletion of the wrong record when multiple records share the same
name (common with _acme-challenge across LE and ZeroSSL issuers).

Use comma-ok type assertions throughout to prevent panics if the
record type invariant is ever broken. Extract the Vultr error
string to a named constant. Document the mutex contract.
2026-03-08 16:35:06 -06:00
Alexandre Almeida
eec1c11265 Remove fmt.Println from provider method 2025-07-23 14:14:03 +02:00
Alexandre Almeida
a45084a707 Query API for record ID if wrapped struct doesn't have it 2025-07-23 13:18:27 +02:00
Alexandre Almeida
62cb30921f Rewrite logic for libdns v1.0.0, do not use ProviderData field 2025-06-07 14:55:54 +02:00
Alexandre Almeida
75a18cd47f Update to libdns v1.1.0 2025-06-01 15:14:24 +02:00
Alexandre Oliveira
7e0b8b3d6a Use empty TODO context instead of nil 2023-03-31 14:18:24 +00:00
Alexandre Oliveira
e079f301dd Implement libdns ZoneLister interface for provider 2023-03-31 14:18:24 +00:00
Alexandre Oliveira
44dad6df97 Update govultr to v3.0.2 2023-03-31 14:18:24 +00:00
Alexandre Oliveira
1448b1a6dd Change the ID of the record added to the ID returned by the API 2020-11-28 13:12:48 +01:00
Alexandre Oliveira
a8fa24426b Add pagination for listing all DNS records 2020-11-28 13:12:01 +01:00
Alexandre Oliveira
ab5efe3967 Update client to reflect Vultr's library changes 2020-11-25 16:30:13 +01:00
Alexandre Oliveira
6e06fbd42e Get list of DNS records before deleting to retrieve ID of recently added record 2020-11-24 21:00:18 +01:00
Alexandre Oliveira
53a04d6a94 Wrap record value in quotes 2020-11-24 20:15:29 +01:00
Alexandre Oliveira
77ddd0389e Stop custom Client struct from being exported in Provider 2020-11-24 00:38:07 +01:00
Alexandre Oliveira
8a738c041b Fix record not being found when updating it 2020-11-02 18:58:43 +01:00
Alexandre Oliveira
ab4c4a2c9e Initial commit 2020-11-02 18:44:07 +01:00