Skip to content

Commit

Permalink
review
Browse files Browse the repository at this point in the history
  • Loading branch information
ldez committed Dec 3, 2024
1 parent 3d4182d commit 21b09ff
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions providers/dns/inwx/inwx.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,17 +180,26 @@ func (d *DNSProvider) CleanUp(domain, token, keyAuth string) error {
return fmt.Errorf("inwx: %w", err)
}

var lastErr error
var recordID int
for _, record := range response.Records {
if record.Content == challengeInfo.Value {
err = d.client.Nameservers.DeleteRecord(record.ID)
if err != nil {
lastErr = fmt.Errorf("inwx: %w", err)
}
if record.Content != challengeInfo.Value {
continue
}

recordID = record.ID
break
}

return lastErr
if recordID == 0 {
return errors.New("inwx: TXT record not found")
}

err = d.client.Nameservers.DeleteRecord(recordID)
if err != nil {
return fmt.Errorf("inwx: %w", err)
}

return nil
}

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

0 comments on commit 21b09ff

Please sign in to comment.