From ad32056381b778a3a154644980da6e332c76e732 Mon Sep 17 00:00:00 2001 From: Fernandez Ludovic Date: Sun, 14 Jan 2024 17:14:50 +0100 Subject: [PATCH] ionos: fix DNS record removal --- providers/dns/ionos/ionos.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/providers/dns/ionos/ionos.go b/providers/dns/ionos/ionos.go index d6150a7065..2ce3de62a0 100644 --- a/providers/dns/ionos/ionos.go +++ b/providers/dns/ionos/ionos.go @@ -6,6 +6,7 @@ import ( "errors" "fmt" "net/http" + "strconv" "strings" "time" @@ -171,8 +172,8 @@ 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) } @@ -180,7 +181,7 @@ func (d *DNSProvider) CleanUp(domain, _, keyAuth string) error { } } - 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 {