namesilo: fix cleanup. (#1240)

This commit is contained in:
Ludovic Fernandez 2020-09-01 10:35:43 +02:00 committed by GitHub
parent b23d947e17
commit 00a2d5dbf8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -124,7 +124,7 @@ func (d *DNSProvider) CleanUp(domain, token, keyAuth string) error {
var lastErr error var lastErr error
name := getRecordName(fqdn, zoneName) name := getRecordName(fqdn, zoneName)
for _, r := range resp.Reply.ResourceRecord { for _, r := range resp.Reply.ResourceRecord {
if r.Type == "TXT" && r.Host == name { if r.Type == "TXT" && (r.Host == name || r.Host == dns01.UnFqdn(fqdn)) {
_, err := d.client.DnsDeleteRecord(&namesilo.DnsDeleteRecordParams{Domain: zoneName, ID: r.RecordID}) _, err := d.client.DnsDeleteRecord(&namesilo.DnsDeleteRecordParams{Domain: zoneName, ID: r.RecordID})
if err != nil { if err != nil {
lastErr = fmt.Errorf("namesilo: %w", err) lastErr = fmt.Errorf("namesilo: %w", err)