Skip to content

Commit

Permalink
chore: simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
ldez committed Sep 29, 2024
1 parent 42ac35d commit 9068993
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions providers/dns/namesilo/namesilo.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,16 +134,18 @@ func (d *DNSProvider) CleanUp(domain, _, keyAuth string) error {
return fmt.Errorf("namesilo: %w", err)
}

var lastErr error
for _, r := range resp.Reply.ResourceRecord {
if r.Type == "TXT" && r.Value == info.Value && (r.Host == subdomain || r.Host == dns01.UnFqdn(info.EffectiveFQDN)) {
_, err := d.client.DnsDeleteRecord(&namesilo.DnsDeleteRecordParams{Domain: zoneName, ID: r.RecordID})
if err != nil {
lastErr = fmt.Errorf("namesilo: %w", err)
return fmt.Errorf("namesilo: %w", err)
}

break
}
}
return lastErr

return nil
}

// Timeout returns the timeout and interval to use when checking for DNS propagation.
Expand Down

0 comments on commit 9068993

Please sign in to comment.