1
0
mirror of https://github.com/go-acme/lego.git synced 2024-11-29 01:42:09 +02:00

namesilo: add cleanup before add a DNS record (#1833)

This commit is contained in:
Roman Pedchenko 2023-02-05 22:54:41 +02:00 committed by GitHub
parent 4a14c315a2
commit e76a104315
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -98,6 +98,11 @@ func (d *DNSProvider) Present(domain, token, keyAuth string) error {
return fmt.Errorf("namesilo: %w", err)
}
err = d.CleanUp(domain, token, keyAuth)
if err != nil {
return err
}
_, err = d.client.DnsAddRecord(&namesilo.DnsAddRecordParams{
Domain: zoneName,
Type: "TXT",
@ -112,7 +117,7 @@ func (d *DNSProvider) Present(domain, token, keyAuth string) error {
}
// CleanUp removes the TXT record matching the specified parameters.
func (d *DNSProvider) CleanUp(domain, token, keyAuth string) error {
func (d *DNSProvider) CleanUp(domain, _, keyAuth string) error {
fqdn, _ := dns01.GetRecord(domain, keyAuth)
zoneName, err := getZoneNameByDomain(fqdn)