Skip to content

Commit

Permalink
ionos: fix DNS record removal (#2083)
Browse files Browse the repository at this point in the history
  • Loading branch information
ldez committed Jan 17, 2024
1 parent c847ac4 commit c17f659
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions providers/dns/ionos/ionos.go
Expand Up @@ -6,6 +6,7 @@ import (
"errors"
"fmt"
"net/http"
"strconv"
"strings"
"time"

Expand Down Expand Up @@ -171,16 +172,16 @@ func (d *DNSProvider) CleanUp(domain, _, keyAuth string) error {
}

for _, record := range records {
if record.Name == dns01.UnFqdn(info.EffectiveFQDN) && record.Content == info.Value {
err := d.client.RemoveRecord(ctx, zone.ID, record.ID)
if record.Name == dns01.UnFqdn(info.EffectiveFQDN) && record.Content == strconv.Quote(info.Value) {
err = d.client.RemoveRecord(ctx, zone.ID, record.ID)
if err != nil {
return fmt.Errorf("ionos: failed to remove record (zone=%s, record=%s): %w", zone.ID, record.ID, err)
}
return nil
}
}

return nil
return fmt.Errorf("ionos: failed to remove record, record not found (zone=%s, domain=%s, fqdn=%s, value=%s)", zone.ID, domain, info.EffectiveFQDN, info.Value)
}

func findZone(zones []internal.Zone, domain string) *internal.Zone {
Expand Down

0 comments on commit c17f659

Please sign in to comment.