diff --git a/challenge/dns01/dns_challenge.go b/challenge/dns01/dns_challenge.go index 3364b93402..e0947e6baa 100644 --- a/challenge/dns01/dns_challenge.go +++ b/challenge/dns01/dns_challenge.go @@ -6,6 +6,7 @@ import ( "fmt" "os" "strconv" + "strings" "time" "github.com/go-acme/lego/v4/acme" @@ -124,7 +125,7 @@ func (c *Challenge) Solve(authz acme.Authorization) error { timeout, interval = DefaultPropagationTimeout, DefaultPollingInterval } - log.Infof("[%s] acme: Checking DNS record propagation using %+v", domain, recursiveNameservers) + log.Infof("[%s] acme: Checking DNS record propagation. [nameservers=%s]", domain, strings.Join(recursiveNameservers, ",")) time.Sleep(interval) diff --git a/challenge/dns01/dns_challenge_manual.go b/challenge/dns01/dns_challenge_manual.go index 6f211fbb21..c00d64041d 100644 --- a/challenge/dns01/dns_challenge_manual.go +++ b/challenge/dns01/dns_challenge_manual.go @@ -25,7 +25,7 @@ func (*DNSProviderManual) Present(domain, token, keyAuth string) error { authZone, err := FindZoneByFqdn(info.EffectiveFQDN) if err != nil { - return err + return fmt.Errorf("manual: could not find zone: %w", err) } fmt.Printf("lego: Please create the following TXT record in your %s zone:\n", authZone) @@ -33,8 +33,11 @@ func (*DNSProviderManual) Present(domain, token, keyAuth string) error { fmt.Printf("lego: Press 'Enter' when you are done\n") _, err = bufio.NewReader(os.Stdin).ReadBytes('\n') + if err != nil { + return fmt.Errorf("manual: %w", err) + } - return err + return nil } // CleanUp prints instructions for manually removing the TXT record. @@ -43,7 +46,7 @@ func (*DNSProviderManual) CleanUp(domain, token, keyAuth string) error { authZone, err := FindZoneByFqdn(info.EffectiveFQDN) if err != nil { - return err + return fmt.Errorf("manual: could not find zone: %w", err) } fmt.Printf("lego: You can now remove this TXT record from your %s zone:\n", authZone) diff --git a/challenge/dns01/nameserver.go b/challenge/dns01/nameserver.go index 1982852a85..206611be4a 100644 --- a/challenge/dns01/nameserver.go +++ b/challenge/dns01/nameserver.go @@ -99,12 +99,12 @@ func lookupNameservers(fqdn string) ([]string, error) { zone, err := FindZoneByFqdn(fqdn) if err != nil { - return nil, fmt.Errorf("could not determine the zone: %w", err) + return nil, fmt.Errorf("could not find zone: %w", err) } r, err := dnsQuery(zone, dns.TypeNS, recursiveNameservers, true) if err != nil { - return nil, err + return nil, fmt.Errorf("NS call failed: %w", err) } for _, rr := range r.Answer { @@ -116,7 +116,8 @@ func lookupNameservers(fqdn string) ([]string, error) { if len(authoritativeNss) > 0 { return authoritativeNss, nil } - return nil, errors.New("could not determine authoritative nameservers") + + return nil, fmt.Errorf("[zone=%s] could not determine authoritative nameservers", zone) } // FindPrimaryNsByFqdn determines the primary nameserver of the zone apex for the given fqdn @@ -130,7 +131,7 @@ func FindPrimaryNsByFqdn(fqdn string) (string, error) { func FindPrimaryNsByFqdnCustom(fqdn string, nameservers []string) (string, error) { soa, err := lookupSoaByFqdn(fqdn, nameservers) if err != nil { - return "", err + return "", fmt.Errorf("[fqdn=%s] %w", fqdn, err) } return soa.primaryNs, nil } @@ -146,7 +147,7 @@ func FindZoneByFqdn(fqdn string) (string, error) { func FindZoneByFqdnCustom(fqdn string, nameservers []string) (string, error) { soa, err := lookupSoaByFqdn(fqdn, nameservers) if err != nil { - return "", err + return "", fmt.Errorf("[fqdn=%s] %w", fqdn, err) } return soa.zone, nil } @@ -171,35 +172,35 @@ func lookupSoaByFqdn(fqdn string, nameservers []string) (*soaCacheEntry, error) func fetchSoaByFqdn(fqdn string, nameservers []string) (*soaCacheEntry, error) { var err error - var in *dns.Msg + var r *dns.Msg labelIndexes := dns.Split(fqdn) for _, index := range labelIndexes { domain := fqdn[index:] - in, err = dnsQuery(domain, dns.TypeSOA, nameservers, true) + r, err = dnsQuery(domain, dns.TypeSOA, nameservers, true) if err != nil { continue } - if in == nil { + if r == nil { continue } - switch in.Rcode { + switch r.Rcode { case dns.RcodeSuccess: // Check if we got a SOA RR in the answer section - if len(in.Answer) == 0 { + if len(r.Answer) == 0 { continue } // CNAME records cannot/should not exist at the root of a zone. // So we skip a domain when a CNAME is found. - if dnsMsgContainsCNAME(in) { + if dnsMsgContainsCNAME(r) { continue } - for _, ans := range in.Answer { + for _, ans := range r.Answer { if soa, ok := ans.(*dns.SOA); ok { return newSoaCacheEntry(soa), nil } @@ -208,11 +209,11 @@ func fetchSoaByFqdn(fqdn string, nameservers []string) (*soaCacheEntry, error) { // NXDOMAIN default: // Any response code other than NOERROR and NXDOMAIN is treated as error - return nil, fmt.Errorf("unexpected response code '%s' for %s", dns.RcodeToString[in.Rcode], domain) + return nil, &DNSError{Message: fmt.Sprintf("unexpected response for '%s'", domain), MsgOut: r} } } - return nil, fmt.Errorf("could not find the start of authority for %s%s", fqdn, formatDNSError(in, err)) + return nil, &DNSError{Message: fmt.Sprintf("could not find the start of authority for '%s'", fqdn), MsgOut: r, Err: err} } // dnsMsgContainsCNAME checks for a CNAME answer in msg. @@ -226,16 +227,28 @@ func dnsMsgContainsCNAME(msg *dns.Msg) bool { func dnsQuery(fqdn string, rtype uint16, nameservers []string, recursive bool) (*dns.Msg, error) { m := createDNSMsg(fqdn, rtype, recursive) - var in *dns.Msg + if len(nameservers) == 0 { + return nil, &DNSError{Message: "empty list of nameservers"} + } + + var r *dns.Msg var err error + var errAll error for _, ns := range nameservers { - in, err = sendDNSQuery(m, ns) - if err == nil && len(in.Answer) > 0 { + r, err = sendDNSQuery(m, ns) + if err == nil && len(r.Answer) > 0 { break } + + errAll = errors.Join(errAll, err) + } + + if err != nil { + return r, errAll } - return in, err + + return r, nil } func createDNSMsg(fqdn string, rtype uint16, recursive bool) *dns.Msg { @@ -253,37 +266,82 @@ func createDNSMsg(fqdn string, rtype uint16, recursive bool) *dns.Msg { func sendDNSQuery(m *dns.Msg, ns string) (*dns.Msg, error) { if ok, _ := strconv.ParseBool(os.Getenv("LEGO_EXPERIMENTAL_DNS_TCP_ONLY")); ok { tcp := &dns.Client{Net: "tcp", Timeout: dnsTimeout} - in, _, err := tcp.Exchange(m, ns) + r, _, err := tcp.Exchange(m, ns) + if err != nil { + return r, &DNSError{Message: "DNS call error", MsgIn: m, NS: ns, Err: err} + } - return in, err + return r, nil } udp := &dns.Client{Net: "udp", Timeout: dnsTimeout} - in, _, err := udp.Exchange(m, ns) + r, _, err := udp.Exchange(m, ns) - if in != nil && in.Truncated { + if r != nil && r.Truncated { tcp := &dns.Client{Net: "tcp", Timeout: dnsTimeout} // If the TCP request succeeds, the "err" will reset to nil - in, _, err = tcp.Exchange(m, ns) + r, _, err = tcp.Exchange(m, ns) + } + + if err != nil { + return r, &DNSError{Message: "DNS call error", MsgIn: m, NS: ns, Err: err} } - return in, err + return r, nil } -func formatDNSError(msg *dns.Msg, err error) string { - var parts []string +// DNSError error related to DNS calls. +type DNSError struct { + Message string + NS string + MsgIn *dns.Msg + MsgOut *dns.Msg + Err error +} - if msg != nil { - parts = append(parts, dns.RcodeToString[msg.Rcode]) +func (d *DNSError) Error() string { + var details []string + if d.NS != "" { + details = append(details, "ns="+d.NS) } - if err != nil { - parts = append(parts, err.Error()) + if d.MsgIn != nil && len(d.MsgIn.Question) > 0 { + details = append(details, fmt.Sprintf("question='%s'", formatQuestions(d.MsgIn.Question))) + } + + if d.MsgOut != nil { + if d.MsgIn == nil || len(d.MsgIn.Question) == 0 { + details = append(details, fmt.Sprintf("question='%s'", formatQuestions(d.MsgOut.Question))) + } + + details = append(details, "code="+dns.RcodeToString[d.MsgOut.Rcode]) + } + + msg := "DNS error" + if d.Message != "" { + msg = d.Message + } + + if d.Err != nil { + msg += ": " + d.Err.Error() + } + + if len(details) > 0 { + msg += " [" + strings.Join(details, ", ") + "]" } - if len(parts) > 0 { - return ": " + strings.Join(parts, " ") + return msg +} + +func (d *DNSError) Unwrap() error { + return d.Err +} + +func formatQuestions(questions []dns.Question) string { + var parts []string + for _, question := range questions { + parts = append(parts, strings.ReplaceAll(strings.TrimPrefix(question.String(), ";"), "\t", " ")) } - return "" + return strings.Join(parts, ";") } diff --git a/challenge/dns01/nameserver_test.go b/challenge/dns01/nameserver_test.go index 10ae36ac0d..5a50f91b1a 100644 --- a/challenge/dns01/nameserver_test.go +++ b/challenge/dns01/nameserver_test.go @@ -1,9 +1,11 @@ package dns01 import ( + "errors" "sort" "testing" + "github.com/miekg/dns" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) @@ -52,7 +54,7 @@ func TestLookupNameserversErr(t *testing.T) { { desc: "invalid tld", fqdn: "_null.n0n0.", - error: "could not determine the zone", + error: "could not find zone", }, } @@ -109,7 +111,7 @@ var findXByFqdnTestCases = []struct { fqdn: "test.lego.zz.", zone: "lego.zz.", nameservers: []string{"8.8.8.8:53"}, - expectedError: "could not find the start of authority for test.lego.zz.: NXDOMAIN", + expectedError: "[fqdn=test.lego.zz.] could not find the start of authority for 'test.lego.zz.' [question='zz. IN SOA', code=NXDOMAIN]", }, { desc: "several non existent nameservers", @@ -119,18 +121,19 @@ var findXByFqdnTestCases = []struct { nameservers: []string{":7053", ":8053", "8.8.8.8:53"}, }, { - desc: "only non-existent nameservers", - fqdn: "mail.google.com.", - zone: "google.com.", - nameservers: []string{":7053", ":8053", ":9053"}, - expectedError: "could not find the start of authority for mail.google.com.: read udp", + desc: "only non-existent nameservers", + fqdn: "mail.google.com.", + zone: "google.com.", + nameservers: []string{":7053", ":8053", ":9053"}, + // use only the start of the message because the port changes with each call: 127.0.0.1:XXXXX->127.0.0.1:7053. + expectedError: "[fqdn=mail.google.com.] could not find the start of authority for 'mail.google.com.': DNS call error: read udp ", }, { desc: "no nameservers", fqdn: "test.ldez.com.", zone: "ldez.com.", nameservers: []string{}, - expectedError: "could not find the start of authority for test.ldez.com.", + expectedError: "[fqdn=test.ldez.com.] could not find the start of authority for 'test.ldez.com.': empty list of nameservers", }, } @@ -142,7 +145,7 @@ func TestFindZoneByFqdnCustom(t *testing.T) { zone, err := FindZoneByFqdnCustom(test.fqdn, test.nameservers) if test.expectedError != "" { require.Error(t, err) - assert.Contains(t, err.Error(), test.expectedError) + assert.ErrorContains(t, err, test.expectedError) } else { require.NoError(t, err) assert.Equal(t, test.zone, zone) @@ -159,7 +162,7 @@ func TestFindPrimaryNsByFqdnCustom(t *testing.T) { ns, err := FindPrimaryNsByFqdnCustom(test.fqdn, test.nameservers) if test.expectedError != "" { require.Error(t, err) - assert.Contains(t, err.Error(), test.expectedError) + assert.ErrorContains(t, err, test.expectedError) } else { require.NoError(t, err) assert.Equal(t, test.primaryNs, ns) @@ -197,3 +200,70 @@ func TestResolveConfServers(t *testing.T) { }) } } + +func TestDNSError_Error(t *testing.T) { + msgIn := createDNSMsg("example.com.", dns.TypeTXT, true) + + msgOut := createDNSMsg("example.org.", dns.TypeSOA, true) + msgOut.Rcode = dns.RcodeNameError + + testCases := []struct { + desc string + err *DNSError + expected string + }{ + { + desc: "empty error", + err: &DNSError{}, + expected: "DNS error", + }, + { + desc: "all fields", + err: &DNSError{ + Message: "Oops", + NS: "example.com.", + MsgIn: msgIn, + MsgOut: msgOut, + Err: errors.New("I did it again"), + }, + expected: "Oops: I did it again [ns=example.com., question='example.com. IN TXT', code=NXDOMAIN]", + }, + { + desc: "only NS", + err: &DNSError{ + NS: "example.com.", + }, + expected: "DNS error [ns=example.com.]", + }, + { + desc: "only MsgIn", + err: &DNSError{ + MsgIn: msgIn, + }, + expected: "DNS error [question='example.com. IN TXT']", + }, + { + desc: "only MsgOut", + err: &DNSError{ + MsgOut: msgOut, + }, + expected: "DNS error [question='example.org. IN SOA', code=NXDOMAIN]", + }, + { + desc: "only Err", + err: &DNSError{ + Err: errors.New("I did it again"), + }, + expected: "DNS error: I did it again", + }, + } + + for _, test := range testCases { + test := test + t.Run(test.desc, func(t *testing.T) { + t.Parallel() + + assert.EqualError(t, test.err, test.expected) + }) + } +} diff --git a/providers/dns/alidns/alidns.go b/providers/dns/alidns/alidns.go index 3962545195..803567e1d8 100644 --- a/providers/dns/alidns/alidns.go +++ b/providers/dns/alidns/alidns.go @@ -198,7 +198,7 @@ func (d *DNSProvider) getHostedZone(domain string) (string, error) { authZone, err := dns01.FindZoneByFqdn(domain) if err != nil { - return "", fmt.Errorf("could not find zone for FQDN %q: %w", domain, err) + return "", fmt.Errorf("could not find zone: %w", err) } var hostedZone alidns.DomainInDescribeDomains diff --git a/providers/dns/allinkl/allinkl.go b/providers/dns/allinkl/allinkl.go index 6525a119b0..aaaca844c5 100644 --- a/providers/dns/allinkl/allinkl.go +++ b/providers/dns/allinkl/allinkl.go @@ -115,7 +115,7 @@ func (d *DNSProvider) Present(domain, token, keyAuth string) error { authZone, err := dns01.FindZoneByFqdn(info.EffectiveFQDN) if err != nil { - return fmt.Errorf("allinkl: could not find zone for domain %q (%s): %w", domain, info.EffectiveFQDN, err) + return fmt.Errorf("allinkl: could not find zone for domain %q: %w", domain, err) } ctx := context.Background() diff --git a/providers/dns/arvancloud/arvancloud.go b/providers/dns/arvancloud/arvancloud.go index c37e3d0877..743713db39 100644 --- a/providers/dns/arvancloud/arvancloud.go +++ b/providers/dns/arvancloud/arvancloud.go @@ -111,7 +111,7 @@ func (d *DNSProvider) Present(domain, token, keyAuth string) error { authZone, err := dns01.FindZoneByFqdn(info.EffectiveFQDN) if err != nil { - return fmt.Errorf("arvancloud: could not find zone for domain %q (%s): %w", domain, info.EffectiveFQDN, err) + return fmt.Errorf("arvancloud: could not find zone for domain %q: %w", domain, err) } authZone = dns01.UnFqdn(authZone) @@ -152,7 +152,7 @@ func (d *DNSProvider) CleanUp(domain, token, keyAuth string) error { authZone, err := dns01.FindZoneByFqdn(info.EffectiveFQDN) if err != nil { - return fmt.Errorf("arvancloud: could not find zone for domain %q (%s): %w", domain, info.EffectiveFQDN, err) + return fmt.Errorf("arvancloud: could not find zone for domain %q: %w", domain, err) } authZone = dns01.UnFqdn(authZone) diff --git a/providers/dns/auroradns/auroradns.go b/providers/dns/auroradns/auroradns.go index 700046c409..2f759d4a30 100644 --- a/providers/dns/auroradns/auroradns.go +++ b/providers/dns/auroradns/auroradns.go @@ -108,7 +108,7 @@ func (d *DNSProvider) Present(domain, token, keyAuth string) error { authZone, err := dns01.FindZoneByFqdn(info.EffectiveFQDN) if err != nil { - return fmt.Errorf("aurora: could not find zone for domain %q (%s): %w", domain, info.EffectiveFQDN, err) + return fmt.Errorf("aurora: could not find zone for domain %q: %w", domain, err) } // 1. Aurora will happily create the TXT record when it is provided a fqdn, @@ -160,7 +160,7 @@ func (d *DNSProvider) CleanUp(domain, token, keyAuth string) error { authZone, err := dns01.FindZoneByFqdn(dns01.ToFqdn(info.EffectiveFQDN)) if err != nil { - return fmt.Errorf("aurora: could not find zone for domain %q (%s): %w", domain, info.EffectiveFQDN, err) + return fmt.Errorf("aurora: could not find zone for domain %q: %w", domain, err) } authZone = dns01.UnFqdn(authZone) diff --git a/providers/dns/azure/private.go b/providers/dns/azure/private.go index 7f1b803f1a..e07af4e375 100644 --- a/providers/dns/azure/private.go +++ b/providers/dns/azure/private.go @@ -118,7 +118,7 @@ func (d *dnsProviderPrivate) getHostedZoneID(ctx context.Context, fqdn string) ( authZone, err := dns01.FindZoneByFqdn(fqdn) if err != nil { - return "", fmt.Errorf("could not find zone for FQDN %q: %w", fqdn, err) + return "", fmt.Errorf("could not find zone: %w", err) } dc := privatedns.NewPrivateZonesClientWithBaseURI(d.config.ResourceManagerEndpoint, d.config.SubscriptionID) diff --git a/providers/dns/azure/public.go b/providers/dns/azure/public.go index 74db5d9aa4..66b458be95 100644 --- a/providers/dns/azure/public.go +++ b/providers/dns/azure/public.go @@ -118,7 +118,7 @@ func (d *dnsProviderPublic) getHostedZoneID(ctx context.Context, fqdn string) (s authZone, err := dns01.FindZoneByFqdn(fqdn) if err != nil { - return "", fmt.Errorf("could not find zone for FQDN %q: %w", fqdn, err) + return "", fmt.Errorf("could not find zone: %w", err) } dc := dns.NewZonesClientWithBaseURI(d.config.ResourceManagerEndpoint, d.config.SubscriptionID) diff --git a/providers/dns/azuredns/private.go b/providers/dns/azuredns/private.go index ccc3afcd6f..27370e99c8 100644 --- a/providers/dns/azuredns/private.go +++ b/providers/dns/azuredns/private.go @@ -141,7 +141,7 @@ func (d *DNSProviderPrivate) getHostedZoneID(ctx context.Context, fqdn string) ( authZone, err := dns01.FindZoneByFqdn(fqdn) if err != nil { - return "", err + return "", fmt.Errorf("could not find zone: %w", err) } zone, err := d.zoneClient.Get(ctx, d.config.ResourceGroup, dns01.UnFqdn(authZone), nil) diff --git a/providers/dns/azuredns/public.go b/providers/dns/azuredns/public.go index d30e94487c..c6d689b323 100644 --- a/providers/dns/azuredns/public.go +++ b/providers/dns/azuredns/public.go @@ -141,7 +141,7 @@ func (d *DNSProviderPublic) getHostedZoneID(ctx context.Context, fqdn string) (s authZone, err := dns01.FindZoneByFqdn(fqdn) if err != nil { - return "", err + return "", fmt.Errorf("could not find zone: %w", err) } zone, err := d.zoneClient.Get(ctx, d.config.ResourceGroup, dns01.UnFqdn(authZone), nil) diff --git a/providers/dns/brandit/brandit.go b/providers/dns/brandit/brandit.go index 33af186ce6..5d7b23d014 100644 --- a/providers/dns/brandit/brandit.go +++ b/providers/dns/brandit/brandit.go @@ -108,7 +108,7 @@ func (d *DNSProvider) Present(domain, token, keyAuth string) error { authZone, err := dns01.FindZoneByFqdn(info.EffectiveFQDN) if err != nil { - return fmt.Errorf("brandit: could not find zone for domain %q (%s): %w", domain, info.EffectiveFQDN, err) + return fmt.Errorf("brandit: could not find zone for domain %q: %w", domain, err) } subDomain, err := dns01.ExtractSubDomain(info.EffectiveFQDN, authZone) @@ -155,7 +155,7 @@ func (d *DNSProvider) CleanUp(domain, token, keyAuth string) error { authZone, err := dns01.FindZoneByFqdn(info.EffectiveFQDN) if err != nil { - return fmt.Errorf("brandit: could not find zone for domain %q (%s): %w", domain, info.EffectiveFQDN, err) + return fmt.Errorf("brandit: could not find zone for domain %q: %w", domain, err) } // gets the record's unique ID diff --git a/providers/dns/bunny/bunny.go b/providers/dns/bunny/bunny.go index 69645c46fb..1286c3df3e 100644 --- a/providers/dns/bunny/bunny.go +++ b/providers/dns/bunny/bunny.go @@ -94,7 +94,7 @@ func (d *DNSProvider) Present(domain, token, keyAuth string) error { authZone, err := getZone(info.EffectiveFQDN) if err != nil { - return fmt.Errorf("bunny: failed to find zone: fqdn=%s: %w", info.EffectiveFQDN, err) + return fmt.Errorf("bunny: could not find zone for domain %q: %w", domain, err) } ctx := context.Background() @@ -129,7 +129,7 @@ func (d *DNSProvider) CleanUp(domain, token, keyAuth string) error { authZone, err := getZone(info.EffectiveFQDN) if err != nil { - return fmt.Errorf("bunny: failed to find zone: fqdn=%s: %w", info.EffectiveFQDN, err) + return fmt.Errorf("bunny: could not find zone for domain %q: %w", domain, err) } ctx := context.Background() diff --git a/providers/dns/civo/civo.go b/providers/dns/civo/civo.go index 3d639eb6bb..26bdc7995c 100644 --- a/providers/dns/civo/civo.go +++ b/providers/dns/civo/civo.go @@ -95,7 +95,7 @@ func (d *DNSProvider) Present(domain, token, keyAuth string) error { authZone, err := dns01.FindZoneByFqdn(info.EffectiveFQDN) if err != nil { - return fmt.Errorf("civo: could not find zone for domain %q (%s): %w", domain, info.EffectiveFQDN, err) + return fmt.Errorf("civo: could not find zone for domain %q: %w", domain, err) } zone := dns01.UnFqdn(authZone) @@ -129,7 +129,7 @@ func (d *DNSProvider) CleanUp(domain, token, keyAuth string) error { authZone, err := dns01.FindZoneByFqdn(info.EffectiveFQDN) if err != nil { - return fmt.Errorf("civo: could not find zone for domain %q (%s): %w", domain, info.EffectiveFQDN, err) + return fmt.Errorf("civo: could not find zone for domain %q: %w", domain, err) } zone := dns01.UnFqdn(authZone) diff --git a/providers/dns/clouddns/clouddns.go b/providers/dns/clouddns/clouddns.go index 7b0644f7f9..c3b13887e8 100644 --- a/providers/dns/clouddns/clouddns.go +++ b/providers/dns/clouddns/clouddns.go @@ -105,7 +105,7 @@ func (d *DNSProvider) Present(domain, token, keyAuth string) error { authZone, err := dns01.FindZoneByFqdn(info.EffectiveFQDN) if err != nil { - return fmt.Errorf("clouddns: could not find zone for domain %q (%s): %w", domain, info.EffectiveFQDN, err) + return fmt.Errorf("clouddns: could not find zone for domain %q: %w", domain, err) } ctx, err := d.client.CreateAuthenticatedContext(context.Background()) @@ -127,7 +127,7 @@ func (d *DNSProvider) CleanUp(domain, token, keyAuth string) error { authZone, err := dns01.FindZoneByFqdn(info.EffectiveFQDN) if err != nil { - return fmt.Errorf("clouddns: could not find zone for domain %q (%s): %w", domain, info.EffectiveFQDN, err) + return fmt.Errorf("clouddns: could not find zone for domain %q: %w", domain, err) } ctx, err := d.client.CreateAuthenticatedContext(context.Background()) diff --git a/providers/dns/cloudflare/cloudflare.go b/providers/dns/cloudflare/cloudflare.go index 2d91fe4bcd..efdbd6e7a0 100644 --- a/providers/dns/cloudflare/cloudflare.go +++ b/providers/dns/cloudflare/cloudflare.go @@ -126,7 +126,7 @@ func (d *DNSProvider) Present(domain, token, keyAuth string) error { authZone, err := dns01.FindZoneByFqdn(info.EffectiveFQDN) if err != nil { - return fmt.Errorf("cloudflare: could not find zone for domain %q (%s): %w", domain, info.EffectiveFQDN, err) + return fmt.Errorf("cloudflare: could not find zone for domain %q: %w", domain, err) } zoneID, err := d.client.ZoneIDByName(authZone) @@ -161,7 +161,7 @@ func (d *DNSProvider) CleanUp(domain, token, keyAuth string) error { authZone, err := dns01.FindZoneByFqdn(info.EffectiveFQDN) if err != nil { - return fmt.Errorf("cloudflare: could not find zone for domain %q (%s): %w", domain, info.EffectiveFQDN, err) + return fmt.Errorf("cloudflare: could not find zone for domain %q: %w", domain, err) } zoneID, err := d.client.ZoneIDByName(authZone) diff --git a/providers/dns/cloudns/internal/client.go b/providers/dns/cloudns/internal/client.go index c4f350f651..60d7e6bbe7 100644 --- a/providers/dns/cloudns/internal/client.go +++ b/providers/dns/cloudns/internal/client.go @@ -55,7 +55,7 @@ func NewClient(authID, subAuthID, authPassword string) (*Client, error) { func (c *Client) GetZone(ctx context.Context, authFQDN string) (*Zone, error) { authZone, err := dns01.FindZoneByFqdn(authFQDN) if err != nil { - return nil, fmt.Errorf("could not find zone for FQDN %q: %w", authFQDN, err) + return nil, fmt.Errorf("could not find zone: %w", err) } authZoneName := dns01.UnFqdn(authZone) diff --git a/providers/dns/cloudru/cloudru.go b/providers/dns/cloudru/cloudru.go index 1813e1a596..68ad21b26f 100644 --- a/providers/dns/cloudru/cloudru.go +++ b/providers/dns/cloudru/cloudru.go @@ -109,7 +109,7 @@ func (d *DNSProvider) Present(domain, token, keyAuth string) error { authZone, err := dns01.FindZoneByFqdn(info.EffectiveFQDN) if err != nil { - return fmt.Errorf("cloudru: could not find zone for domain %q (%s): %w", domain, info.EffectiveFQDN, err) + return fmt.Errorf("cloudru: could not find zone for domain %q: %w", domain, err) } authZone = dns01.UnFqdn(authZone) diff --git a/providers/dns/cloudxns/internal/client.go b/providers/dns/cloudxns/internal/client.go index 39e17d9682..37f10fe872 100644 --- a/providers/dns/cloudxns/internal/client.go +++ b/providers/dns/cloudxns/internal/client.go @@ -60,7 +60,7 @@ func (c *Client) GetDomainInformation(ctx context.Context, fqdn string) (*Data, authZone, err := dns01.FindZoneByFqdn(fqdn) if err != nil { - return nil, fmt.Errorf("could not find zone for FQDN %q: %w", fqdn, err) + return nil, fmt.Errorf("could not find zone: %w", err) } var domains []Data diff --git a/providers/dns/conoha/conoha.go b/providers/dns/conoha/conoha.go index e19ba4d4c6..32755b9f3a 100644 --- a/providers/dns/conoha/conoha.go +++ b/providers/dns/conoha/conoha.go @@ -126,7 +126,7 @@ func (d *DNSProvider) Present(domain, token, keyAuth string) error { authZone, err := dns01.FindZoneByFqdn(info.EffectiveFQDN) if err != nil { - return fmt.Errorf("conoha: could not find zone for domain %q (%s): %w", domain, info.EffectiveFQDN, err) + return fmt.Errorf("conoha: could not find zone for domain %q: %w", domain, err) } ctx := context.Background() @@ -157,7 +157,7 @@ func (d *DNSProvider) CleanUp(domain, token, keyAuth string) error { authZone, err := dns01.FindZoneByFqdn(info.EffectiveFQDN) if err != nil { - return fmt.Errorf("conoha: could not find zone for domain %q (%s): %w", domain, info.EffectiveFQDN, err) + return fmt.Errorf("conoha: could not find zone for domain %q: %w", domain, err) } ctx := context.Background() diff --git a/providers/dns/constellix/constellix.go b/providers/dns/constellix/constellix.go index 20d25ccda5..10b75e9a3a 100644 --- a/providers/dns/constellix/constellix.go +++ b/providers/dns/constellix/constellix.go @@ -110,7 +110,7 @@ func (d *DNSProvider) Present(domain, token, keyAuth string) error { authZone, err := dns01.FindZoneByFqdn(info.EffectiveFQDN) if err != nil { - return fmt.Errorf("constellix: could not find zone for domain %q (%s): %w", domain, info.EffectiveFQDN, err) + return fmt.Errorf("constellix: could not find zone for domain %q: %w", domain, err) } ctx := context.Background() @@ -153,7 +153,7 @@ func (d *DNSProvider) CleanUp(domain, token, keyAuth string) error { authZone, err := dns01.FindZoneByFqdn(info.EffectiveFQDN) if err != nil { - return fmt.Errorf("constellix: could not find zone for domain %q (%s): %w", domain, info.EffectiveFQDN, err) + return fmt.Errorf("constellix: could not find zone for domain %q: %w", domain, err) } ctx := context.Background() diff --git a/providers/dns/cpanel/cpanel.go b/providers/dns/cpanel/cpanel.go index c0573df3e5..bb025c2a3d 100644 --- a/providers/dns/cpanel/cpanel.go +++ b/providers/dns/cpanel/cpanel.go @@ -126,7 +126,7 @@ func (d *DNSProvider) Present(domain, _, keyAuth string) error { authZone, err := dns01.FindZoneByFqdn(info.EffectiveFQDN) if err != nil { - return fmt.Errorf("arvancloud: could not find zone for domain %q (%s): %w", domain, info.EffectiveFQDN, err) + return fmt.Errorf("arvancloud: could not find zone for domain %q: %w", domain, err) } zone := dns01.UnFqdn(authZone) @@ -200,7 +200,7 @@ func (d *DNSProvider) CleanUp(domain, _, keyAuth string) error { authZone, err := dns01.FindZoneByFqdn(info.EffectiveFQDN) if err != nil { - return fmt.Errorf("arvancloud: could not find zone for domain %q (%s): %w", domain, info.EffectiveFQDN, err) + return fmt.Errorf("arvancloud: could not find zone for domain %q: %w", domain, err) } zone := dns01.UnFqdn(authZone) diff --git a/providers/dns/derak/derak.go b/providers/dns/derak/derak.go index 52157dcb8c..28262fb04d 100644 --- a/providers/dns/derak/derak.go +++ b/providers/dns/derak/derak.go @@ -111,7 +111,7 @@ func (d *DNSProvider) Present(domain, token, keyAuth string) error { authZone, err := dns01.FindZoneByFqdn(info.EffectiveFQDN) if err != nil { - return fmt.Errorf("derak: could not find zone for domain %q (%s): %w", domain, info.EffectiveFQDN, err) + return fmt.Errorf("derak: could not find zone for domain %q: %w", domain, err) } recordName, err := dns01.ExtractSubDomain(info.EffectiveFQDN, authZone) diff --git a/providers/dns/desec/desec.go b/providers/dns/desec/desec.go index 971c96d530..c86e0ceb82 100644 --- a/providers/dns/desec/desec.go +++ b/providers/dns/desec/desec.go @@ -106,7 +106,7 @@ func (d *DNSProvider) Present(domain, token, keyAuth string) error { authZone, err := dns01.FindZoneByFqdn(info.EffectiveFQDN) if err != nil { - return fmt.Errorf("desec: could not find zone for domain %q (%s): %w", domain, info.EffectiveFQDN, err) + return fmt.Errorf("desec: could not find zone for domain %q: %w", domain, err) } recordName, err := dns01.ExtractSubDomain(info.EffectiveFQDN, authZone) @@ -156,7 +156,7 @@ func (d *DNSProvider) CleanUp(domain, token, keyAuth string) error { authZone, err := dns01.FindZoneByFqdn(info.EffectiveFQDN) if err != nil { - return fmt.Errorf("desec: could not find zone for domain %q (%s): %w", domain, info.EffectiveFQDN, err) + return fmt.Errorf("desec: could not find zone for domain %q: %w", domain, err) } recordName, err := dns01.ExtractSubDomain(info.EffectiveFQDN, authZone) diff --git a/providers/dns/designate/designate.go b/providers/dns/designate/designate.go index 8447a31f05..9492633160 100644 --- a/providers/dns/designate/designate.go +++ b/providers/dns/designate/designate.go @@ -129,7 +129,7 @@ func (d *DNSProvider) Present(domain, token, keyAuth string) error { authZone, err := dns01.FindZoneByFqdn(info.EffectiveFQDN) if err != nil { - return fmt.Errorf("designate: could not find zone for domain %q (%s): %w", domain, info.EffectiveFQDN, err) + return fmt.Errorf("designate: could not find zone for domain %q: %w", domain, err) } zoneID, err := d.getZoneID(authZone) @@ -169,7 +169,7 @@ func (d *DNSProvider) CleanUp(domain, token, keyAuth string) error { authZone, err := dns01.FindZoneByFqdn(info.EffectiveFQDN) if err != nil { - return fmt.Errorf("designate: could not find zone for domain %q (%s): %w", domain, info.EffectiveFQDN, err) + return fmt.Errorf("designate: could not find zone for domain %q: %w", domain, err) } zoneID, err := d.getZoneID(authZone) diff --git a/providers/dns/digitalocean/digitalocean.go b/providers/dns/digitalocean/digitalocean.go index dd790faa79..792c11f354 100644 --- a/providers/dns/digitalocean/digitalocean.go +++ b/providers/dns/digitalocean/digitalocean.go @@ -114,7 +114,7 @@ func (d *DNSProvider) Present(domain, token, keyAuth string) error { authZone, err := dns01.FindZoneByFqdn(dns01.ToFqdn(info.EffectiveFQDN)) if err != nil { - return fmt.Errorf("designate: could not find zone for domain %q (%s): %w", domain, info.EffectiveFQDN, err) + return fmt.Errorf("digitalocean: could not find zone for domain %q: %w", domain, err) } record := internal.Record{Type: "TXT", Name: info.EffectiveFQDN, Data: info.Value, TTL: d.config.TTL} @@ -137,7 +137,7 @@ func (d *DNSProvider) CleanUp(domain, token, keyAuth string) error { authZone, err := dns01.FindZoneByFqdn(info.EffectiveFQDN) if err != nil { - return fmt.Errorf("designate: could not find zone for domain %q (%s): %w", domain, info.EffectiveFQDN, err) + return fmt.Errorf("digitalocean: could not find zone for domain %q: %w", domain, err) } // get the record's unique ID from when we created it diff --git a/providers/dns/dnsmadeeasy/dnsmadeeasy.go b/providers/dns/dnsmadeeasy/dnsmadeeasy.go index 50512fe6ad..7f4ca2af33 100644 --- a/providers/dns/dnsmadeeasy/dnsmadeeasy.go +++ b/providers/dns/dnsmadeeasy/dnsmadeeasy.go @@ -120,7 +120,7 @@ func (d *DNSProvider) Present(domainName, token, keyAuth string) error { authZone, err := dns01.FindZoneByFqdn(info.EffectiveFQDN) if err != nil { - return fmt.Errorf("dnsmadeeasy: could not find zone for domain %q (%s): %w", domainName, info.EffectiveFQDN, err) + return fmt.Errorf("dnsmadeeasy: could not find zone for domain %q: %w", domainName, err) } ctx := context.Background() @@ -148,7 +148,7 @@ func (d *DNSProvider) CleanUp(domainName, token, keyAuth string) error { authZone, err := dns01.FindZoneByFqdn(info.EffectiveFQDN) if err != nil { - return fmt.Errorf("dnsmadeeasy: could not find zone for domain %q (%s): %w", domainName, info.EffectiveFQDN, err) + return fmt.Errorf("dnsmadeeasy: could not find zone for domain %q: %w", domainName, err) } ctx := context.Background() diff --git a/providers/dns/dnspod/dnspod.go b/providers/dns/dnspod/dnspod.go index c20caf3cd0..5f8e848808 100644 --- a/providers/dns/dnspod/dnspod.go +++ b/providers/dns/dnspod/dnspod.go @@ -143,7 +143,7 @@ func (d *DNSProvider) getHostedZone(domain string) (string, string, error) { authZone, err := dns01.FindZoneByFqdn(domain) if err != nil { - return "", "", fmt.Errorf("could not find zone for FQDN %q: %w", domain, err) + return "", "", fmt.Errorf("could not find zone: %w", err) } var hostedZone dnspod.Domain diff --git a/providers/dns/domeneshop/domeneshop.go b/providers/dns/domeneshop/domeneshop.go index c9f7fcd981..d074ba53fc 100644 --- a/providers/dns/domeneshop/domeneshop.go +++ b/providers/dns/domeneshop/domeneshop.go @@ -143,7 +143,7 @@ func (d *DNSProvider) CleanUp(domain, _, keyAuth string) error { func (d *DNSProvider) splitDomain(fqdn string) (string, string, error) { zone, err := dns01.FindZoneByFqdn(fqdn) if err != nil { - return "", "", fmt.Errorf("could not find zone for FQDN %q: %w", fqdn, err) + return "", "", fmt.Errorf("could not find zone: %w", err) } subDomain, err := dns01.ExtractSubDomain(fqdn, zone) diff --git a/providers/dns/dyn/dyn.go b/providers/dns/dyn/dyn.go index 1b2d825462..3435110e59 100644 --- a/providers/dns/dyn/dyn.go +++ b/providers/dns/dyn/dyn.go @@ -98,7 +98,7 @@ func (d *DNSProvider) Present(domain, token, keyAuth string) error { authZone, err := dns01.FindZoneByFqdn(info.EffectiveFQDN) if err != nil { - return fmt.Errorf("dyn: could not find zone for domain %q (%s): %w", domain, info.EffectiveFQDN, err) + return fmt.Errorf("dyn: could not find zone for domain %q: %w", domain, err) } ctx, err := d.client.CreateAuthenticatedContext(context.Background()) @@ -125,7 +125,7 @@ func (d *DNSProvider) CleanUp(domain, token, keyAuth string) error { authZone, err := dns01.FindZoneByFqdn(info.EffectiveFQDN) if err != nil { - return fmt.Errorf("dyn: could not find zone for domain %q (%s): %w", domain, info.EffectiveFQDN, err) + return fmt.Errorf("dyn: could not find zone for domain %q: %w", domain, err) } ctx, err := d.client.CreateAuthenticatedContext(context.Background()) diff --git a/providers/dns/epik/epik.go b/providers/dns/epik/epik.go index 8114a21cd7..4d4fb8c73a 100644 --- a/providers/dns/epik/epik.go +++ b/providers/dns/epik/epik.go @@ -99,7 +99,7 @@ func (d *DNSProvider) Present(domain, token, keyAuth string) error { // find authZone authZone, err := dns01.FindZoneByFqdn(info.EffectiveFQDN) if err != nil { - return fmt.Errorf("epik: could not find zone for domain %q (%s): %w", domain, info.EffectiveFQDN, err) + return fmt.Errorf("epik: could not find zone for domain %q: %w", domain, err) } subDomain, err := dns01.ExtractSubDomain(info.EffectiveFQDN, authZone) @@ -129,7 +129,7 @@ func (d *DNSProvider) CleanUp(domain, token, keyAuth string) error { // find authZone authZone, err := dns01.FindZoneByFqdn(info.EffectiveFQDN) if err != nil { - return fmt.Errorf("epik: could not find zone for domain %q (%s): %w", domain, info.EffectiveFQDN, err) + return fmt.Errorf("epik: could not find zone for domain %q: %w", domain, err) } dom := dns01.UnFqdn(authZone) diff --git a/providers/dns/exoscale/exoscale.go b/providers/dns/exoscale/exoscale.go index 770899f934..e5c72cc661 100644 --- a/providers/dns/exoscale/exoscale.go +++ b/providers/dns/exoscale/exoscale.go @@ -116,7 +116,7 @@ func (d *DNSProvider) Present(domain, token, keyAuth string) error { zoneName, recordName, err := d.findZoneAndRecordName(info.EffectiveFQDN) if err != nil { - return err + return fmt.Errorf("exoscale: %w", err) } zone, err := d.findExistingZone(zoneName) @@ -171,7 +171,7 @@ func (d *DNSProvider) CleanUp(domain, token, keyAuth string) error { zoneName, recordName, err := d.findZoneAndRecordName(info.EffectiveFQDN) if err != nil { - return err + return fmt.Errorf("exoscale: %w", err) } zone, err := d.findExistingZone(zoneName) @@ -246,7 +246,7 @@ func (d *DNSProvider) findExistingRecordID(zoneID, recordName string) (string, e func (d *DNSProvider) findZoneAndRecordName(fqdn string) (string, string, error) { zone, err := dns01.FindZoneByFqdn(fqdn) if err != nil { - return "", "", fmt.Errorf("designate: could not find zone for FQDN %q: %w", fqdn, err) + return "", "", fmt.Errorf("could not find zone: %w", err) } zone = dns01.UnFqdn(zone) diff --git a/providers/dns/gandi/gandi.go b/providers/dns/gandi/gandi.go index 29af01a900..93e94f276d 100644 --- a/providers/dns/gandi/gandi.go +++ b/providers/dns/gandi/gandi.go @@ -131,7 +131,7 @@ func (d *DNSProvider) Present(domain, token, keyAuth string) error { // find authZone and Gandi zone_id for fqdn authZone, err := d.findZoneByFqdn(info.EffectiveFQDN) if err != nil { - return fmt.Errorf("gandi: could not find zone for domain %q (%s): %w", domain, info.EffectiveFQDN, err) + return fmt.Errorf("gandi: could not find zone for domain %q: %w", domain, err) } ctx := context.Background() diff --git a/providers/dns/gandiv5/gandiv5.go b/providers/dns/gandiv5/gandiv5.go index d5b8bb5b50..8b342592b4 100644 --- a/providers/dns/gandiv5/gandiv5.go +++ b/providers/dns/gandiv5/gandiv5.go @@ -134,7 +134,7 @@ func (d *DNSProvider) Present(domain, token, keyAuth string) error { // find authZone authZone, err := d.findZoneByFqdn(info.EffectiveFQDN) if err != nil { - return fmt.Errorf("gandiv5: could not find zone for domain %q (%s): %w", domain, info.EffectiveFQDN, err) + return fmt.Errorf("gandiv5: could not find zone for domain %q: %w", domain, err) } // determine name of TXT record diff --git a/providers/dns/gcloud/googlecloud.go b/providers/dns/gcloud/googlecloud.go index ff9fb6f077..7e4cd8d752 100644 --- a/providers/dns/gcloud/googlecloud.go +++ b/providers/dns/gcloud/googlecloud.go @@ -360,7 +360,7 @@ func (d *DNSProvider) lookupHostedZoneID(domain string) (string, []*dns.ManagedZ authZone, err := dns01.FindZoneByFqdn(dns01.ToFqdn(domain)) if err != nil { - return "", nil, fmt.Errorf("could not find zone for FQDN %q: %w", domain, err) + return "", nil, fmt.Errorf("could not find zone: %w", err) } zones, err := d.client.ManagedZones. diff --git a/providers/dns/glesys/glesys.go b/providers/dns/glesys/glesys.go index 95b5f08708..c25b693c50 100644 --- a/providers/dns/glesys/glesys.go +++ b/providers/dns/glesys/glesys.go @@ -110,7 +110,7 @@ func (d *DNSProvider) Present(domain, token, keyAuth string) error { // find authZone authZone, err := dns01.FindZoneByFqdn(info.EffectiveFQDN) if err != nil { - return fmt.Errorf("glesys: could not find zone for domain %q (%s): %w", domain, info.EffectiveFQDN, err) + return fmt.Errorf("glesys: could not find zone for domain %q: %w", domain, err) } subDomain, err := dns01.ExtractSubDomain(info.EffectiveFQDN, authZone) diff --git a/providers/dns/godaddy/godaddy.go b/providers/dns/godaddy/godaddy.go index f9d4b99c90..f872f217e4 100644 --- a/providers/dns/godaddy/godaddy.go +++ b/providers/dns/godaddy/godaddy.go @@ -107,7 +107,7 @@ func (d *DNSProvider) Present(domain, token, keyAuth string) error { authZone, err := dns01.FindZoneByFqdn(info.EffectiveFQDN) if err != nil { - return fmt.Errorf("godaddy: could not find zone for domain %q (%s): %w", domain, info.EffectiveFQDN, err) + return fmt.Errorf("godaddy: could not find zone for domain %q: %w", domain, err) } authZone = dns01.UnFqdn(authZone) @@ -153,7 +153,7 @@ func (d *DNSProvider) CleanUp(domain, token, keyAuth string) error { authZone, err := dns01.FindZoneByFqdn(info.EffectiveFQDN) if err != nil { - return fmt.Errorf("godaddy: could not find zone for domain %q (%s): %w", domain, info.EffectiveFQDN, err) + return fmt.Errorf("godaddy: could not find zone for domain %q: %w", domain, err) } authZone = dns01.UnFqdn(authZone) diff --git a/providers/dns/googledomains/googledomains.go b/providers/dns/googledomains/googledomains.go index b8206dbfbd..a87895c607 100644 --- a/providers/dns/googledomains/googledomains.go +++ b/providers/dns/googledomains/googledomains.go @@ -89,7 +89,7 @@ type DNSProvider struct { func (d *DNSProvider) Present(domain, token, keyAuth string) error { zone, err := dns01.FindZoneByFqdn(dns01.ToFqdn(domain)) if err != nil { - return fmt.Errorf("googledomains: error finding zone for domain %s: %w", domain, err) + return fmt.Errorf("googledomains: could not find zone for domain %q: %w", domain, err) } rotateReq := acmedns.RotateChallengesRequest{ @@ -109,7 +109,7 @@ func (d *DNSProvider) Present(domain, token, keyAuth string) error { func (d *DNSProvider) CleanUp(domain, token, keyAuth string) error { zone, err := dns01.FindZoneByFqdn(dns01.ToFqdn(domain)) if err != nil { - return fmt.Errorf("googledomains: error finding zone for domain %s: %w", domain, err) + return fmt.Errorf("googledomains: could not find zone for domain %q: %w", domain, err) } rotateReq := acmedns.RotateChallengesRequest{ diff --git a/providers/dns/hetzner/hetzner.go b/providers/dns/hetzner/hetzner.go index f66178617b..facffea49b 100644 --- a/providers/dns/hetzner/hetzner.go +++ b/providers/dns/hetzner/hetzner.go @@ -103,7 +103,7 @@ func (d *DNSProvider) Present(domain, token, keyAuth string) error { authZone, err := dns01.FindZoneByFqdn(info.EffectiveFQDN) if err != nil { - return fmt.Errorf("hetzner: could not find zone for domain %q (%s): %w", domain, info.EffectiveFQDN, err) + return fmt.Errorf("hetzner: could not find zone for domain %q: %w", domain, err) } zone := dns01.UnFqdn(authZone) @@ -141,7 +141,7 @@ func (d *DNSProvider) CleanUp(domain, token, keyAuth string) error { authZone, err := dns01.FindZoneByFqdn(info.EffectiveFQDN) if err != nil { - return fmt.Errorf("hetzner: could not find zone for domain %q (%s): %w", domain, info.EffectiveFQDN, err) + return fmt.Errorf("hetzner: could not find zone for domain %q: %w", domain, err) } zone := dns01.UnFqdn(authZone) diff --git a/providers/dns/hostingde/hostingde.go b/providers/dns/hostingde/hostingde.go index c1e3f1b8b9..db8868965c 100644 --- a/providers/dns/hostingde/hostingde.go +++ b/providers/dns/hostingde/hostingde.go @@ -208,7 +208,7 @@ func (d *DNSProvider) getZoneName(fqdn string) (string, error) { zoneName, err := dns01.FindZoneByFqdn(fqdn) if err != nil { - return "", fmt.Errorf("could not find zone for FQDN %q: %w", fqdn, err) + return "", fmt.Errorf("could not find zone: %w", err) } if zoneName == "" { diff --git a/providers/dns/hosttech/hosttech.go b/providers/dns/hosttech/hosttech.go index 41073f3c8e..94a6a07957 100644 --- a/providers/dns/hosttech/hosttech.go +++ b/providers/dns/hosttech/hosttech.go @@ -102,7 +102,7 @@ func (d *DNSProvider) Present(domain, token, keyAuth string) error { authZone, err := dns01.FindZoneByFqdn(info.EffectiveFQDN) if err != nil { - return fmt.Errorf("hosttech: could not find zone for domain %q (%s): %w", domain, info.EffectiveFQDN, err) + return fmt.Errorf("hosttech: could not find zone for domain %q: %w", domain, err) } ctx := context.Background() @@ -142,7 +142,7 @@ func (d *DNSProvider) CleanUp(domain, token, keyAuth string) error { authZone, err := dns01.FindZoneByFqdn(info.EffectiveFQDN) if err != nil { - return fmt.Errorf("hosttech: could not find zone for domain %q (%s): %w", domain, info.EffectiveFQDN, err) + return fmt.Errorf("hosttech: could not find zone for domain %q: %w", domain, err) } ctx := context.Background() diff --git a/providers/dns/httpnet/httpnet.go b/providers/dns/httpnet/httpnet.go index 45b7185b07..88a13f4698 100644 --- a/providers/dns/httpnet/httpnet.go +++ b/providers/dns/httpnet/httpnet.go @@ -212,7 +212,7 @@ func (d *DNSProvider) getZoneName(fqdn string) (string, error) { zoneName, err := dns01.FindZoneByFqdn(fqdn) if err != nil { - return "", fmt.Errorf("could not find zone for FQDN %q: %w", fqdn, err) + return "", fmt.Errorf("could not find zone: %w", err) } if zoneName == "" { diff --git a/providers/dns/hyperone/hyperone.go b/providers/dns/hyperone/hyperone.go index 5e23c0a3e7..8578b5c523 100644 --- a/providers/dns/hyperone/hyperone.go +++ b/providers/dns/hyperone/hyperone.go @@ -191,7 +191,7 @@ func (d *DNSProvider) CleanUp(domain, _, keyAuth string) error { func (d *DNSProvider) getHostedZone(ctx context.Context, fqdn string) (*internal.Zone, error) { authZone, err := dns01.FindZoneByFqdn(fqdn) if err != nil { - return nil, fmt.Errorf("hetzner: could not find zone for FQDN %q: %w", fqdn, err) + return nil, fmt.Errorf("could not find zone: %w", err) } return d.client.FindZone(ctx, authZone) diff --git a/providers/dns/joker/provider_dmapi.go b/providers/dns/joker/provider_dmapi.go index b33d7d4893..ec85d57058 100644 --- a/providers/dns/joker/provider_dmapi.go +++ b/providers/dns/joker/provider_dmapi.go @@ -78,7 +78,7 @@ func (d *dmapiProvider) Present(domain, token, keyAuth string) error { zone, err := dns01.FindZoneByFqdn(info.EffectiveFQDN) if err != nil { - return fmt.Errorf("joker: could not find zone for domain %q (%s): %w", domain, info.EffectiveFQDN, err) + return fmt.Errorf("joker: could not find zone for domain %q: %w", domain, err) } subDomain, err := dns01.ExtractSubDomain(info.EffectiveFQDN, zone) @@ -116,7 +116,7 @@ func (d *dmapiProvider) CleanUp(domain, token, keyAuth string) error { zone, err := dns01.FindZoneByFqdn(info.EffectiveFQDN) if err != nil { - return fmt.Errorf("joker: could not find zone for domain %q (%s): %w", domain, info.EffectiveFQDN, err) + return fmt.Errorf("joker: could not find zone for domain %q: %w", domain, err) } subDomain, err := dns01.ExtractSubDomain(info.EffectiveFQDN, zone) diff --git a/providers/dns/joker/provider_svc.go b/providers/dns/joker/provider_svc.go index 837a050342..c9edfded14 100644 --- a/providers/dns/joker/provider_svc.go +++ b/providers/dns/joker/provider_svc.go @@ -59,7 +59,7 @@ func (d *svcProvider) Present(domain, token, keyAuth string) error { zone, err := dns01.FindZoneByFqdn(info.EffectiveFQDN) if err != nil { - return fmt.Errorf("joker: could not find zone for domain %q (%s): %w", domain, info.EffectiveFQDN, err) + return fmt.Errorf("joker: could not find zone for domain %q: %w", domain, err) } subDomain, err := dns01.ExtractSubDomain(info.EffectiveFQDN, zone) @@ -76,7 +76,7 @@ func (d *svcProvider) CleanUp(domain, token, keyAuth string) error { zone, err := dns01.FindZoneByFqdn(info.EffectiveFQDN) if err != nil { - return fmt.Errorf("joker: could not find zone for domain %q (%s): %w", domain, info.EffectiveFQDN, err) + return fmt.Errorf("joker: could not find zone for domain %q: %w", domain, err) } subDomain, err := dns01.ExtractSubDomain(info.EffectiveFQDN, zone) diff --git a/providers/dns/liara/liara.go b/providers/dns/liara/liara.go index 27d3e600bf..cb4ab7c8dd 100644 --- a/providers/dns/liara/liara.go +++ b/providers/dns/liara/liara.go @@ -123,7 +123,7 @@ func (d *DNSProvider) Present(domain, token, keyAuth string) error { authZone, err := dns01.FindZoneByFqdn(info.EffectiveFQDN) if err != nil { - return fmt.Errorf("liara: could not find zone for domain %q (%s): %w", domain, info.EffectiveFQDN, err) + return fmt.Errorf("liara: could not find zone for domain %q: %w", domain, err) } subDomain, err := dns01.ExtractSubDomain(info.EffectiveFQDN, authZone) @@ -155,7 +155,7 @@ func (d *DNSProvider) CleanUp(domain, token, keyAuth string) error { authZone, err := dns01.FindZoneByFqdn(info.EffectiveFQDN) if err != nil { - return fmt.Errorf("liara: could not find zone for domain %q (%s): %w", domain, info.EffectiveFQDN, err) + return fmt.Errorf("liara: could not find zone for domain %q: %w", domain, err) } // gets the record's unique ID diff --git a/providers/dns/linode/linode.go b/providers/dns/linode/linode.go index 2ed8192b2a..54af31e2e2 100644 --- a/providers/dns/linode/linode.go +++ b/providers/dns/linode/linode.go @@ -177,7 +177,7 @@ func (d *DNSProvider) getHostedZoneInfo(fqdn string) (*hostedZoneInfo, error) { // Lookup the zone that handles the specified FQDN. authZone, err := dns01.FindZoneByFqdn(fqdn) if err != nil { - return nil, fmt.Errorf("inwx: could not find zone for FQDN %q: %w", fqdn, err) + return nil, fmt.Errorf("could not find zone: %w", err) } // Query the authority zone. diff --git a/providers/dns/loopia/loopia.go b/providers/dns/loopia/loopia.go index dc2623be08..582a247fa9 100644 --- a/providers/dns/loopia/loopia.go +++ b/providers/dns/loopia/loopia.go @@ -201,7 +201,7 @@ func (d *DNSProvider) CleanUp(domain, token, keyAuth string) error { func (d *DNSProvider) splitDomain(fqdn string) (string, string, error) { authZone, err := d.findZoneByFqdn(fqdn) if err != nil { - return "", "", fmt.Errorf("desec: could not find zone for FQDN %q: %w", fqdn, err) + return "", "", fmt.Errorf("could not find zone: %w", err) } subDomain, err := dns01.ExtractSubDomain(fqdn, authZone) diff --git a/providers/dns/luadns/luadns.go b/providers/dns/luadns/luadns.go index 5f6f6cc236..86dfb7d29d 100644 --- a/providers/dns/luadns/luadns.go +++ b/providers/dns/luadns/luadns.go @@ -124,7 +124,7 @@ func (d *DNSProvider) Present(domain, token, keyAuth string) error { authZone, err := dns01.FindZoneByFqdn(info.EffectiveFQDN) if err != nil { - return fmt.Errorf("luadns: could not find zone for domain %q (%s): %w", domain, info.EffectiveFQDN, err) + return fmt.Errorf("luadns: could not find zone for domain %q: %w", domain, err) } zone := findZone(zones, dns01.UnFqdn(authZone)) diff --git a/providers/dns/metaname/metaname.go b/providers/dns/metaname/metaname.go index f742bcbdd8..ab5a4dff25 100644 --- a/providers/dns/metaname/metaname.go +++ b/providers/dns/metaname/metaname.go @@ -92,7 +92,7 @@ func (d *DNSProvider) Present(domain, token, keyAuth string) error { authZone, err := dns01.FindZoneByFqdn(info.EffectiveFQDN) if err != nil { - return fmt.Errorf("metaname: could not find zone for domain %q (%s): %w", domain, info.EffectiveFQDN, err) + return fmt.Errorf("metaname: could not find zone for domain %q: %w", domain, err) } authZone = dns01.UnFqdn(authZone) @@ -129,7 +129,7 @@ func (d *DNSProvider) CleanUp(domain, token, keyAuth string) error { authZone, err := dns01.FindZoneByFqdn(info.EffectiveFQDN) if err != nil { - return fmt.Errorf("metaname: could not find zone for domain %q (%s): %w", domain, info.EffectiveFQDN, err) + return fmt.Errorf("metaname: could not find zone for domain %q: %w", domain, err) } authZone = dns01.UnFqdn(authZone) diff --git a/providers/dns/mythicbeasts/mythicbeasts.go b/providers/dns/mythicbeasts/mythicbeasts.go index 7545b3fbb7..a23ff5701e 100644 --- a/providers/dns/mythicbeasts/mythicbeasts.go +++ b/providers/dns/mythicbeasts/mythicbeasts.go @@ -123,7 +123,7 @@ func (d *DNSProvider) Present(domain, token, keyAuth string) error { authZone, err := dns01.FindZoneByFqdn(info.EffectiveFQDN) if err != nil { - return fmt.Errorf("mythicbeasts: could not find zone for domain %q (%s): %w", domain, info.EffectiveFQDN, err) + return fmt.Errorf("mythicbeasts: could not find zone for domain %q: %w", domain, err) } subDomain, err := dns01.ExtractSubDomain(info.EffectiveFQDN, authZone) @@ -152,7 +152,7 @@ func (d *DNSProvider) CleanUp(domain, token, keyAuth string) error { authZone, err := dns01.FindZoneByFqdn(info.EffectiveFQDN) if err != nil { - return fmt.Errorf("mythicbeasts: could not find zone for domain %q (%s): %w", domain, info.EffectiveFQDN, err) + return fmt.Errorf("mythicbeasts: could not find zone for domain %q: %w", domain, err) } subDomain, err := dns01.ExtractSubDomain(info.EffectiveFQDN, authZone) diff --git a/providers/dns/namesilo/namesilo.go b/providers/dns/namesilo/namesilo.go index bd1a3553d6..61d9e68196 100644 --- a/providers/dns/namesilo/namesilo.go +++ b/providers/dns/namesilo/namesilo.go @@ -90,7 +90,7 @@ func (d *DNSProvider) Present(domain, token, keyAuth string) error { zone, err := dns01.FindZoneByFqdn(info.EffectiveFQDN) if err != nil { - return fmt.Errorf("namesilo: could not find zone for domain %q (%s): %w", domain, info.EffectiveFQDN, err) + return fmt.Errorf("namesilo: could not find zone for domain %q: %w", domain, err) } zoneName := dns01.UnFqdn(zone) @@ -124,7 +124,7 @@ func (d *DNSProvider) CleanUp(domain, _, keyAuth string) error { zone, err := dns01.FindZoneByFqdn(info.EffectiveFQDN) if err != nil { - return fmt.Errorf("namesilo: could not find zone for domain %q (%s): %w", domain, info.EffectiveFQDN, err) + return fmt.Errorf("namesilo: could not find zone for domain %q: %w", domain, err) } zoneName := dns01.UnFqdn(zone) diff --git a/providers/dns/nearlyfreespeech/nearlyfreespeech.go b/providers/dns/nearlyfreespeech/nearlyfreespeech.go index eb001da83a..8f94e0911c 100644 --- a/providers/dns/nearlyfreespeech/nearlyfreespeech.go +++ b/providers/dns/nearlyfreespeech/nearlyfreespeech.go @@ -113,7 +113,7 @@ func (d *DNSProvider) Present(domain, token, keyAuth string) error { authZone, err := dns01.FindZoneByFqdn(info.EffectiveFQDN) if err != nil { - return fmt.Errorf("nearlyfreespeech: could not find zone for domain %q (%s): %w", domain, info.EffectiveFQDN, err) + return fmt.Errorf("nearlyfreespeech: could not find zone for domain %q: %w", domain, err) } recordName, err := dns01.ExtractSubDomain(info.EffectiveFQDN, authZone) @@ -142,7 +142,7 @@ func (d *DNSProvider) CleanUp(domain, token, keyAuth string) error { authZone, err := dns01.FindZoneByFqdn(info.EffectiveFQDN) if err != nil { - return fmt.Errorf("nearlyfreespeech: could not find zone for domain %q (%s): %w", domain, info.EffectiveFQDN, err) + return fmt.Errorf("nearlyfreespeech: could not find zone for domain %q: %w", domain, err) } recordName, err := dns01.ExtractSubDomain(info.EffectiveFQDN, authZone) diff --git a/providers/dns/netcup/netcup.go b/providers/dns/netcup/netcup.go index 328c25a1aa..a8fc8b1726 100644 --- a/providers/dns/netcup/netcup.go +++ b/providers/dns/netcup/netcup.go @@ -97,7 +97,7 @@ func (d *DNSProvider) Present(domain, token, keyAuth string) error { zone, err := dns01.FindZoneByFqdn(info.EffectiveFQDN) if err != nil { - return fmt.Errorf("netcup: could not find zone for domain %q (%s): %w", domain, info.EffectiveFQDN, err) + return fmt.Errorf("netcup: could not find zone for domain %q: %w", domain, err) } ctx, err := d.client.CreateSessionContext(context.Background()) @@ -144,7 +144,7 @@ func (d *DNSProvider) CleanUp(domain, token, keyAuth string) error { zone, err := dns01.FindZoneByFqdn(info.EffectiveFQDN) if err != nil { - return fmt.Errorf("netcup: could not find zone for domain %q (%s): %w", domain, info.EffectiveFQDN, err) + return fmt.Errorf("netcup: could not find zone for domain %q: %w", domain, err) } ctx, err := d.client.CreateSessionContext(context.Background()) diff --git a/providers/dns/netlify/netlify.go b/providers/dns/netlify/netlify.go index 28e85f5406..1a65e330de 100644 --- a/providers/dns/netlify/netlify.go +++ b/providers/dns/netlify/netlify.go @@ -102,7 +102,7 @@ func (d *DNSProvider) Present(domain, token, keyAuth string) error { authZone, err := dns01.FindZoneByFqdn(info.EffectiveFQDN) if err != nil { - return fmt.Errorf("netlify: could not find zone for domain %q (%s): %w", domain, info.EffectiveFQDN, err) + return fmt.Errorf("netlify: could not find zone for domain %q: %w", domain, err) } authZone = dns01.UnFqdn(authZone) @@ -132,7 +132,7 @@ func (d *DNSProvider) CleanUp(domain, token, keyAuth string) error { authZone, err := dns01.FindZoneByFqdn(info.EffectiveFQDN) if err != nil { - return fmt.Errorf("netlify: could not find zone for domain %q (%s): %w", domain, info.EffectiveFQDN, err) + return fmt.Errorf("netlify: could not find zone for domain %q: %w", domain, err) } authZone = dns01.UnFqdn(authZone) diff --git a/providers/dns/nicmanager/nicmanager.go b/providers/dns/nicmanager/nicmanager.go index 5e8ff24f0b..5f7eaff609 100644 --- a/providers/dns/nicmanager/nicmanager.go +++ b/providers/dns/nicmanager/nicmanager.go @@ -140,7 +140,7 @@ func (d *DNSProvider) Present(domain, token, keyAuth string) error { rootDomain, err := dns01.FindZoneByFqdn(info.EffectiveFQDN) if err != nil { - return fmt.Errorf("nicmanager: could not find zone for domain %q (%s): %w", domain, info.EffectiveFQDN, err) + return fmt.Errorf("nicmanager: could not find zone for domain %q: %w", domain, err) } ctx := context.Background() @@ -173,7 +173,7 @@ func (d *DNSProvider) CleanUp(domain, token, keyAuth string) error { rootDomain, err := dns01.FindZoneByFqdn(info.EffectiveFQDN) if err != nil { - return fmt.Errorf("nicmanager: could not find zone for domain %q (%s): %w", domain, info.EffectiveFQDN, err) + return fmt.Errorf("nicmanager: could not find zone for domain %q: %w", domain, err) } ctx := context.Background() diff --git a/providers/dns/nifcloud/nifcloud.go b/providers/dns/nifcloud/nifcloud.go index 5078175afb..8185eb3054 100644 --- a/providers/dns/nifcloud/nifcloud.go +++ b/providers/dns/nifcloud/nifcloud.go @@ -161,7 +161,7 @@ func (d *DNSProvider) changeRecord(action, fqdn, value string, ttl int) error { authZone, err := dns01.FindZoneByFqdn(fqdn) if err != nil { - return fmt.Errorf("could not find zone for FQDN %q: %w", fqdn, err) + return fmt.Errorf("could not find zone: %w", err) } ctx := context.Background() diff --git a/providers/dns/nodion/nodion.go b/providers/dns/nodion/nodion.go index 6b2a0be2b9..e1ce72e81d 100644 --- a/providers/dns/nodion/nodion.go +++ b/providers/dns/nodion/nodion.go @@ -109,7 +109,7 @@ func (d *DNSProvider) Present(domain, token, keyAuth string) error { authZone, err := dns01.FindZoneByFqdn(info.EffectiveFQDN) if err != nil { - return fmt.Errorf("nodion: could not find zone for domain %q (%s): %w", domain, info.EffectiveFQDN, err) + return fmt.Errorf("nodion: could not find zone for domain %q: %w", domain, err) } subDomain, err := dns01.ExtractSubDomain(info.EffectiveFQDN, authZone) @@ -160,7 +160,7 @@ func (d *DNSProvider) CleanUp(domain, token, keyAuth string) error { authZone, err := dns01.FindZoneByFqdn(info.EffectiveFQDN) if err != nil { - return fmt.Errorf("nodion: could not find zone for domain %q (%s): %w", domain, info.EffectiveFQDN, err) + return fmt.Errorf("nodion: could not find zone for domain %q: %w", domain, err) } d.zoneIDsMu.Lock() diff --git a/providers/dns/ns1/ns1.go b/providers/dns/ns1/ns1.go index 33f3b16c26..1ec02353cb 100644 --- a/providers/dns/ns1/ns1.go +++ b/providers/dns/ns1/ns1.go @@ -152,7 +152,7 @@ func (d *DNSProvider) Timeout() (timeout, interval time.Duration) { func (d *DNSProvider) getHostedZone(fqdn string) (*dns.Zone, error) { authZone, err := dns01.FindZoneByFqdn(fqdn) if err != nil { - return nil, fmt.Errorf("could not find zone for FQDN %q: %w", fqdn, err) + return nil, fmt.Errorf("could not find zone: %w", err) } authZone = dns01.UnFqdn(authZone) diff --git a/providers/dns/oraclecloud/oraclecloud.go b/providers/dns/oraclecloud/oraclecloud.go index 755cffc7e1..54f00d08b8 100644 --- a/providers/dns/oraclecloud/oraclecloud.go +++ b/providers/dns/oraclecloud/oraclecloud.go @@ -107,7 +107,7 @@ func (d *DNSProvider) Present(domain, token, keyAuth string) error { zoneNameOrID, err := dns01.FindZoneByFqdn(info.EffectiveFQDN) if err != nil { - return fmt.Errorf("oraclecloud: could not find zone for domain %q (%s): %w", domain, info.EffectiveFQDN, err) + return fmt.Errorf("oraclecloud: could not find zone for domain %q: %w", domain, err) } // generate request to dns.PatchDomainRecordsRequest @@ -142,7 +142,7 @@ func (d *DNSProvider) CleanUp(domain, token, keyAuth string) error { zoneNameOrID, err := dns01.FindZoneByFqdn(info.EffectiveFQDN) if err != nil { - return fmt.Errorf("oraclecloud: could not find zone for domain %q (%s): %w", domain, info.EffectiveFQDN, err) + return fmt.Errorf("oraclecloud: could not find zone for domain %q: %w", domain, err) } // search to TXT record's hash to delete diff --git a/providers/dns/otc/otc.go b/providers/dns/otc/otc.go index f61f74e5ad..f2526b87e0 100644 --- a/providers/dns/otc/otc.go +++ b/providers/dns/otc/otc.go @@ -135,7 +135,7 @@ func (d *DNSProvider) Present(domain, token, keyAuth string) error { authZone, err := dns01.FindZoneByFqdn(info.EffectiveFQDN) if err != nil { - return fmt.Errorf("otc: could not find zone for domain %q (%s): %w", domain, info.EffectiveFQDN, err) + return fmt.Errorf("otc: could not find zone for domain %q: %w", domain, err) } ctx := context.Background() @@ -172,7 +172,7 @@ func (d *DNSProvider) CleanUp(domain, token, keyAuth string) error { authZone, err := dns01.FindZoneByFqdn(info.EffectiveFQDN) if err != nil { - return fmt.Errorf("otc: could not find zone for domain %q (%s): %w", domain, info.EffectiveFQDN, err) + return fmt.Errorf("otc: could not find zone for domain %q: %w", domain, err) } ctx := context.Background() diff --git a/providers/dns/ovh/ovh.go b/providers/dns/ovh/ovh.go index 9f269f6d77..a98c2b0d07 100644 --- a/providers/dns/ovh/ovh.go +++ b/providers/dns/ovh/ovh.go @@ -127,7 +127,7 @@ func (d *DNSProvider) Present(domain, token, keyAuth string) error { // Parse domain name authZone, err := dns01.FindZoneByFqdn(info.EffectiveFQDN) if err != nil { - return fmt.Errorf("ovh: could not find zone for domain %q (%s): %w", domain, info.EffectiveFQDN, err) + return fmt.Errorf("ovh: could not find zone for domain %q: %w", domain, err) } authZone = dns01.UnFqdn(authZone) @@ -175,7 +175,7 @@ func (d *DNSProvider) CleanUp(domain, token, keyAuth string) error { authZone, err := dns01.FindZoneByFqdn(info.EffectiveFQDN) if err != nil { - return fmt.Errorf("ovh: could not find zone for domain %q (%s): %w", domain, info.EffectiveFQDN, err) + return fmt.Errorf("ovh: could not find zone for domain %q: %w", domain, err) } authZone = dns01.UnFqdn(authZone) diff --git a/providers/dns/pdns/pdns.go b/providers/dns/pdns/pdns.go index f3d3e2b864..751501b751 100644 --- a/providers/dns/pdns/pdns.go +++ b/providers/dns/pdns/pdns.go @@ -121,7 +121,7 @@ func (d *DNSProvider) Present(domain, token, keyAuth string) error { authZone, err := dns01.FindZoneByFqdn(info.EffectiveFQDN) if err != nil { - return fmt.Errorf("pdns: could not find zone for domain %q (%s): %w", domain, info.EffectiveFQDN, err) + return fmt.Errorf("pdns: could not find zone for domain %q: %w", domain, err) } ctx := context.Background() @@ -183,7 +183,7 @@ func (d *DNSProvider) CleanUp(domain, token, keyAuth string) error { authZone, err := dns01.FindZoneByFqdn(info.EffectiveFQDN) if err != nil { - return fmt.Errorf("pdns: could not find zone for domain %q (%s): %w", domain, info.EffectiveFQDN, err) + return fmt.Errorf("pdns: could not find zone for domain %q: %w", domain, err) } ctx := context.Background() diff --git a/providers/dns/plesk/plesk.go b/providers/dns/plesk/plesk.go index aa0fc1ddad..5b279c5f8f 100644 --- a/providers/dns/plesk/plesk.go +++ b/providers/dns/plesk/plesk.go @@ -123,7 +123,7 @@ func (d *DNSProvider) Present(domain, token, keyAuth string) error { authZone, err := dns01.FindZoneByFqdn(info.EffectiveFQDN) if err != nil { - return fmt.Errorf("plesk: could not find zone for domain %q (%s): %w", domain, info.EffectiveFQDN, err) + return fmt.Errorf("plesk: could not find zone for domain %q: %w", domain, err) } ctx := context.Background() diff --git a/providers/dns/porkbun/porkbun.go b/providers/dns/porkbun/porkbun.go index 86435f37ab..3df5120fb6 100644 --- a/providers/dns/porkbun/porkbun.go +++ b/providers/dns/porkbun/porkbun.go @@ -171,7 +171,7 @@ func (d *DNSProvider) CleanUp(domain, token, keyAuth string) error { func splitDomain(fqdn string) (string, string, error) { zone, err := dns01.FindZoneByFqdn(fqdn) if err != nil { - return "", "", fmt.Errorf("could not find zone for FQDN %q: %w", fqdn, err) + return "", "", fmt.Errorf("could not find zone: %w", err) } subDomain, err := dns01.ExtractSubDomain(fqdn, zone) diff --git a/providers/dns/rackspace/internal/client.go b/providers/dns/rackspace/internal/client.go index 525556a2ca..cbfdd1bfa1 100644 --- a/providers/dns/rackspace/internal/client.go +++ b/providers/dns/rackspace/internal/client.go @@ -80,7 +80,7 @@ func (c *Client) DeleteRecord(ctx context.Context, zoneID, recordID string) erro func (c *Client) GetHostedZoneID(ctx context.Context, fqdn string) (string, error) { authZone, err := dns01.FindZoneByFqdn(fqdn) if err != nil { - return "", fmt.Errorf("could not find zone for FQDN %q: %w", fqdn, err) + return "", fmt.Errorf("could not find zone: %w", err) } zoneSearchResponse, err := c.listDomainsByName(ctx, dns01.UnFqdn(authZone)) diff --git a/providers/dns/rcodezero/rcodezero.go b/providers/dns/rcodezero/rcodezero.go index b19563e53b..3011f193f6 100644 --- a/providers/dns/rcodezero/rcodezero.go +++ b/providers/dns/rcodezero/rcodezero.go @@ -100,7 +100,7 @@ func (d *DNSProvider) Present(domain, token, keyAuth string) error { authZone, err := dns01.FindZoneByFqdn(info.EffectiveFQDN) if err != nil { - return fmt.Errorf("rcodezero: could not find zone for domain %q (%s): %w", domain, info.EffectiveFQDN, err) + return fmt.Errorf("rcodezero: could not find zone for domain %q: %w", domain, err) } rrSet := []internal.UpdateRRSet{{ @@ -127,7 +127,7 @@ func (d *DNSProvider) CleanUp(domain, token, keyAuth string) error { authZone, err := dns01.FindZoneByFqdn(info.EffectiveFQDN) if err != nil { - return fmt.Errorf("rcodezero: could not find zone for domain %q (%s): %w", domain, info.EffectiveFQDN, err) + return fmt.Errorf("rcodezero: could not find zone for domain %q: %w", domain, err) } rrSet := []internal.UpdateRRSet{{ diff --git a/providers/dns/regru/regru.go b/providers/dns/regru/regru.go index 3f6f75f3ab..144b7faf9f 100644 --- a/providers/dns/regru/regru.go +++ b/providers/dns/regru/regru.go @@ -130,7 +130,7 @@ func (d *DNSProvider) Present(domain, token, keyAuth string) error { authZone, err := dns01.FindZoneByFqdn(info.EffectiveFQDN) if err != nil { - return fmt.Errorf("regru: could not find zone for domain %q (%s): %w", domain, info.EffectiveFQDN, err) + return fmt.Errorf("regru: could not find zone for domain %q: %w", domain, err) } subDomain, err := dns01.ExtractSubDomain(info.EffectiveFQDN, authZone) @@ -153,7 +153,7 @@ func (d *DNSProvider) CleanUp(domain, token, keyAuth string) error { authZone, err := dns01.FindZoneByFqdn(info.EffectiveFQDN) if err != nil { - return fmt.Errorf("regru: could not find zone for domain %q (%s): %w", domain, info.EffectiveFQDN, err) + return fmt.Errorf("regru: could not find zone for domain %q: %w", domain, err) } subDomain, err := dns01.ExtractSubDomain(info.EffectiveFQDN, authZone) diff --git a/providers/dns/safedns/safedns.go b/providers/dns/safedns/safedns.go index 8285f3a0ec..cbf2170298 100644 --- a/providers/dns/safedns/safedns.go +++ b/providers/dns/safedns/safedns.go @@ -105,7 +105,7 @@ func (d *DNSProvider) Present(domain, token, keyAuth string) error { zone, err := dns01.FindZoneByFqdn(dns01.ToFqdn(info.EffectiveFQDN)) if err != nil { - return fmt.Errorf("safedns: could not find zone for domain %q (%s): %w", domain, info.EffectiveFQDN, err) + return fmt.Errorf("safedns: could not find zone for domain %q: %w", domain, err) } record := internal.Record{ @@ -133,7 +133,7 @@ func (d *DNSProvider) CleanUp(domain, token, keyAuth string) error { authZone, err := dns01.FindZoneByFqdn(info.EffectiveFQDN) if err != nil { - return fmt.Errorf("safedns: could not find zone for domain %q (%s): %w", domain, info.EffectiveFQDN, err) + return fmt.Errorf("safedns: could not find zone for domain %q: %w", domain, err) } d.recordIDsMu.Lock() diff --git a/providers/dns/sakuracloud/wrapper.go b/providers/dns/sakuracloud/wrapper.go index 2bf8ac9fd1..a74478f6c7 100644 --- a/providers/dns/sakuracloud/wrapper.go +++ b/providers/dns/sakuracloud/wrapper.go @@ -82,7 +82,7 @@ func (d *DNSProvider) cleanupTXTRecord(fqdn, value string) error { func (d *DNSProvider) getHostedZone(domain string) (*iaas.DNS, error) { authZone, err := dns01.FindZoneByFqdn(domain) if err != nil { - return nil, fmt.Errorf("could not find zone for FQDN %q: %w", domain, err) + return nil, fmt.Errorf("could not find zone: %w", err) } zoneName := dns01.UnFqdn(authZone) diff --git a/providers/dns/servercow/servercow.go b/providers/dns/servercow/servercow.go index e43a225c82..3a8ae1f2a5 100644 --- a/providers/dns/servercow/servercow.go +++ b/providers/dns/servercow/servercow.go @@ -214,7 +214,7 @@ func (d *DNSProvider) CleanUp(domain, token, keyAuth string) error { func getAuthZone(domain string) (string, error) { authZone, err := dns01.FindZoneByFqdn(domain) if err != nil { - return "", fmt.Errorf("could not find zone for FQDN %q: %w", domain, err) + return "", fmt.Errorf("could not find zone: %w", err) } zoneName := dns01.UnFqdn(authZone) diff --git a/providers/dns/simply/simply.go b/providers/dns/simply/simply.go index 5376b3a476..2433c4e06c 100644 --- a/providers/dns/simply/simply.go +++ b/providers/dns/simply/simply.go @@ -115,7 +115,7 @@ func (d *DNSProvider) Present(domain, token, keyAuth string) error { authZone, err := dns01.FindZoneByFqdn(info.EffectiveFQDN) if err != nil { - return fmt.Errorf("simply: could not find zone for domain %q (%s): %w", domain, info.EffectiveFQDN, err) + return fmt.Errorf("simply: could not find zone for domain %q: %w", domain, err) } authZone = dns01.UnFqdn(authZone) @@ -150,7 +150,7 @@ func (d *DNSProvider) CleanUp(domain, token, keyAuth string) error { authZone, err := dns01.FindZoneByFqdn(info.EffectiveFQDN) if err != nil { - return fmt.Errorf("simply: could not find zone for domain %q (%s): %w", domain, info.EffectiveFQDN, err) + return fmt.Errorf("simply: could not find zone for domain %q: %w", domain, err) } authZone = dns01.UnFqdn(authZone) diff --git a/providers/dns/tencentcloud/wrapper.go b/providers/dns/tencentcloud/wrapper.go index af608bb32f..32b66d5238 100644 --- a/providers/dns/tencentcloud/wrapper.go +++ b/providers/dns/tencentcloud/wrapper.go @@ -33,7 +33,7 @@ func (d *DNSProvider) getHostedZone(domain string) (*dnspod.DomainListItem, erro authZone, err := dns01.FindZoneByFqdn(domain) if err != nil { - return nil, fmt.Errorf("could not find zone for FQDN %q : %w", domain, err) + return nil, fmt.Errorf("could not find zone: %w", err) } var hostedZone *dnspod.DomainListItem diff --git a/providers/dns/transip/transip.go b/providers/dns/transip/transip.go index e18f2f0f1e..a3b18d862f 100644 --- a/providers/dns/transip/transip.go +++ b/providers/dns/transip/transip.go @@ -95,7 +95,7 @@ func (d *DNSProvider) Present(domain, token, keyAuth string) error { authZone, err := dns01.FindZoneByFqdn(info.EffectiveFQDN) if err != nil { - return fmt.Errorf("transip: could not find zone for domain %q (%s): %w", domain, info.EffectiveFQDN, err) + return fmt.Errorf("transip: could not find zone for domain %q: %w", domain, err) } // get the subDomain @@ -127,7 +127,7 @@ func (d *DNSProvider) CleanUp(domain, token, keyAuth string) error { authZone, err := dns01.FindZoneByFqdn(info.EffectiveFQDN) if err != nil { - return fmt.Errorf("transip: could not find zone for domain %q (%s): %w", domain, info.EffectiveFQDN, err) + return fmt.Errorf("transip: could not find zone for domain %q: %w", domain, err) } // get the subDomain diff --git a/providers/dns/ultradns/ultradns.go b/providers/dns/ultradns/ultradns.go index 2c39e9c06c..5e2811959f 100644 --- a/providers/dns/ultradns/ultradns.go +++ b/providers/dns/ultradns/ultradns.go @@ -105,7 +105,7 @@ func (d *DNSProvider) Present(domain, token, keyAuth string) error { authZone, err := dns01.FindZoneByFqdn(info.EffectiveFQDN) if err != nil { - return fmt.Errorf("ultradns: could not find zone for domain %q (%s): %w", domain, info.EffectiveFQDN, err) + return fmt.Errorf("ultradns: could not find zone for domain %q: %w", domain, err) } recordService, err := record.Get(d.client) @@ -146,7 +146,7 @@ func (d *DNSProvider) CleanUp(domain, token, keyAuth string) error { authZone, err := dns01.FindZoneByFqdn(info.EffectiveFQDN) if err != nil { - return fmt.Errorf("ultradns: could not find zone for domain %q (%s): %w", domain, info.EffectiveFQDN, err) + return fmt.Errorf("ultradns: could not find zone for domain %q: %w", domain, err) } recordService, err := record.Get(d.client) diff --git a/providers/dns/variomedia/variomedia.go b/providers/dns/variomedia/variomedia.go index e87220f4e5..4a7d0e9016 100644 --- a/providers/dns/variomedia/variomedia.go +++ b/providers/dns/variomedia/variomedia.go @@ -113,7 +113,7 @@ func (d *DNSProvider) Present(domain, token, keyAuth string) error { authZone, err := dns01.FindZoneByFqdn(info.EffectiveFQDN) if err != nil { - return fmt.Errorf("variomedia: could not find zone for domain %q (%s): %w", domain, info.EffectiveFQDN, err) + return fmt.Errorf("variomedia: could not find zone for domain %q: %w", domain, err) } subDomain, err := dns01.ExtractSubDomain(info.EffectiveFQDN, authZone) diff --git a/providers/dns/vercel/vercel.go b/providers/dns/vercel/vercel.go index efc401c4fb..491251fe51 100644 --- a/providers/dns/vercel/vercel.go +++ b/providers/dns/vercel/vercel.go @@ -104,7 +104,7 @@ func (d *DNSProvider) Present(domain, token, keyAuth string) error { authZone, err := dns01.FindZoneByFqdn(info.EffectiveFQDN) if err != nil { - return fmt.Errorf("vercel: could not find zone for domain %q (%s): %w", domain, info.EffectiveFQDN, err) + return fmt.Errorf("vercel: could not find zone for domain %q: %w", domain, err) } record := internal.Record{ @@ -132,7 +132,7 @@ func (d *DNSProvider) CleanUp(domain, token, keyAuth string) error { authZone, err := dns01.FindZoneByFqdn(info.EffectiveFQDN) if err != nil { - return fmt.Errorf("vercel: could not find zone for domain %q (%s): %w", domain, info.EffectiveFQDN, err) + return fmt.Errorf("vercel: could not find zone for domain %q: %w", domain, err) } // get the record's unique ID from when we created it diff --git a/providers/dns/versio/versio.go b/providers/dns/versio/versio.go index bee7e52621..b1310f0bc6 100644 --- a/providers/dns/versio/versio.go +++ b/providers/dns/versio/versio.go @@ -120,7 +120,7 @@ func (d *DNSProvider) Present(domain, token, keyAuth string) error { authZone, err := dns01.FindZoneByFqdn(info.EffectiveFQDN) if err != nil { - return fmt.Errorf("versio: could not find zone for domain %q (%s): %w", domain, info.EffectiveFQDN, err) + return fmt.Errorf("versio: could not find zone for domain %q: %w", domain, err) } // use mutex to prevent race condition from getDNSRecords until postDNSRecords @@ -161,7 +161,7 @@ func (d *DNSProvider) CleanUp(domain, token, keyAuth string) error { authZone, err := dns01.FindZoneByFqdn(info.EffectiveFQDN) if err != nil { - return fmt.Errorf("versio: could not find zone for domain %q (%s): %w", domain, info.EffectiveFQDN, err) + return fmt.Errorf("versio: could not find zone for domain %q: %w", domain, err) } // use mutex to prevent race condition from getDNSRecords until postDNSRecords diff --git a/providers/dns/vinyldns/wrapper.go b/providers/dns/vinyldns/wrapper.go index 34b93e9e03..f17b3de313 100644 --- a/providers/dns/vinyldns/wrapper.go +++ b/providers/dns/vinyldns/wrapper.go @@ -116,7 +116,7 @@ func (d *DNSProvider) waitForChanges(operation string, resp *vinyldns.RecordSetU func splitDomain(fqdn string) (string, string, error) { zone, err := dns01.FindZoneByFqdn(fqdn) if err != nil { - return "", "", fmt.Errorf("could not find zone for FDQN %q: %w", fqdn, err) + return "", "", fmt.Errorf("could not find zone: %w", err) } subDomain, err := dns01.ExtractSubDomain(fqdn, zone) diff --git a/providers/dns/vkcloud/vkcloud.go b/providers/dns/vkcloud/vkcloud.go index 49acfc0805..d27feca81e 100644 --- a/providers/dns/vkcloud/vkcloud.go +++ b/providers/dns/vkcloud/vkcloud.go @@ -121,7 +121,7 @@ func (r *DNSProvider) Present(domain, _, keyAuth string) error { authZone, err := dns01.FindZoneByFqdn(info.EffectiveFQDN) if err != nil { - return fmt.Errorf("vkcloud: could not find zone for domain %q (%s): %w", domain, info.EffectiveFQDN, err) + return fmt.Errorf("vkcloud: could not find zone for domain %q: %w", domain, err) } authZone = dns01.UnFqdn(authZone) @@ -161,7 +161,7 @@ func (r *DNSProvider) CleanUp(domain, _, keyAuth string) error { authZone, err := dns01.FindZoneByFqdn(info.EffectiveFQDN) if err != nil { - return fmt.Errorf("vkcloud: could not find zone for domain %q (%s): %w", domain, info.EffectiveFQDN, err) + return fmt.Errorf("vkcloud: could not find zone for domain %q: %w", domain, err) } authZone = dns01.UnFqdn(authZone) diff --git a/providers/dns/webnames/webnames.go b/providers/dns/webnames/webnames.go index 02cacf6ad3..dcc26347e0 100644 --- a/providers/dns/webnames/webnames.go +++ b/providers/dns/webnames/webnames.go @@ -89,7 +89,7 @@ func (d *DNSProvider) Present(domain, token, keyAuth string) error { authZone, err := dns01.FindZoneByFqdn(info.EffectiveFQDN) if err != nil { - return fmt.Errorf("webnames: could not find zone for domain %q (%s): %w", domain, info.EffectiveFQDN, err) + return fmt.Errorf("webnames: could not find zone for domain %q: %w", domain, err) } subDomain, err := dns01.ExtractSubDomain(info.EffectiveFQDN, authZone) @@ -112,7 +112,7 @@ func (d *DNSProvider) CleanUp(domain, token, keyAuth string) error { authZone, err := dns01.FindZoneByFqdn(info.EffectiveFQDN) if err != nil { - return fmt.Errorf("webnames: could not find zone for domain %q (%s): %w", domain, info.EffectiveFQDN, err) + return fmt.Errorf("webnames: could not find zone for domain %q: %w", domain, err) } subDomain, err := dns01.ExtractSubDomain(info.EffectiveFQDN, authZone) diff --git a/providers/dns/websupport/websupport.go b/providers/dns/websupport/websupport.go index f727db167a..3a257b4250 100644 --- a/providers/dns/websupport/websupport.go +++ b/providers/dns/websupport/websupport.go @@ -105,7 +105,7 @@ func (d *DNSProvider) Present(domain, token, keyAuth string) error { authZone, err := dns01.FindZoneByFqdn(info.EffectiveFQDN) if err != nil { - return fmt.Errorf("websupport: could not find zone for domain %q (%s): %w", domain, info.EffectiveFQDN, err) + return fmt.Errorf("websupport: could not find zone for domain %q: %w", domain, err) } subDomain, err := dns01.ExtractSubDomain(info.EffectiveFQDN, authZone) @@ -142,7 +142,7 @@ func (d *DNSProvider) CleanUp(domain, token, keyAuth string) error { authZone, err := dns01.FindZoneByFqdn(info.EffectiveFQDN) if err != nil { - return fmt.Errorf("websupport: could not find zone for domain %q (%s): %w", domain, info.EffectiveFQDN, err) + return fmt.Errorf("websupport: could not find zone for domain %q: %w", domain, err) } // gets the record's unique ID diff --git a/providers/dns/wedos/wedos.go b/providers/dns/wedos/wedos.go index 8fffd3ad8b..0004c49f81 100644 --- a/providers/dns/wedos/wedos.go +++ b/providers/dns/wedos/wedos.go @@ -108,7 +108,7 @@ func (d *DNSProvider) Present(domain, token, keyAuth string) error { authZone, err := dns01.FindZoneByFqdn(info.EffectiveFQDN) if err != nil { - return fmt.Errorf("wedos: could not find zone for domain %q (%s): %w", domain, info.EffectiveFQDN, err) + return fmt.Errorf("wedos: could not find zone for domain %q: %w", domain, err) } subDomain, err := dns01.ExtractSubDomain(info.EffectiveFQDN, authZone) @@ -156,7 +156,7 @@ func (d *DNSProvider) CleanUp(domain, token, keyAuth string) error { authZone, err := dns01.FindZoneByFqdn(info.EffectiveFQDN) if err != nil { - return fmt.Errorf("wedos: could not find zone for domain %q (%s): %w", domain, info.EffectiveFQDN, err) + return fmt.Errorf("wedos: could not find zone for domain %q: %w", domain, err) } subDomain, err := dns01.ExtractSubDomain(info.EffectiveFQDN, authZone) diff --git a/providers/dns/yandex360/yandex360.go b/providers/dns/yandex360/yandex360.go index 837a5e7132..38aa835d84 100644 --- a/providers/dns/yandex360/yandex360.go +++ b/providers/dns/yandex360/yandex360.go @@ -107,7 +107,7 @@ func (d *DNSProvider) Present(domain, token, keyAuth string) error { authZone, err := dns01.FindZoneByFqdn(dns01.ToFqdn(info.EffectiveFQDN)) if err != nil { - return fmt.Errorf("yandex360: could not find zone for domain %q (%s): %w", domain, info.EffectiveFQDN, err) + return fmt.Errorf("yandex360: could not find zone for domain %q: %w", domain, err) } subDomain, err := dns01.ExtractSubDomain(info.EffectiveFQDN, authZone) @@ -142,7 +142,7 @@ func (d *DNSProvider) CleanUp(domain, token, keyAuth string) error { authZone, err := dns01.FindZoneByFqdn(dns01.ToFqdn(info.EffectiveFQDN)) if err != nil { - return fmt.Errorf("yandex360: could not find zone for domain %q (%s): %w", domain, info.EffectiveFQDN, err) + return fmt.Errorf("yandex360: could not find zone for domain %q: %w", domain, err) } authZone = dns01.UnFqdn(authZone) diff --git a/providers/dns/yandexcloud/yandexcloud.go b/providers/dns/yandexcloud/yandexcloud.go index eb1bb20e49..7a5d0bbedf 100644 --- a/providers/dns/yandexcloud/yandexcloud.go +++ b/providers/dns/yandexcloud/yandexcloud.go @@ -105,7 +105,7 @@ func (r *DNSProvider) Present(domain, _, keyAuth string) error { authZone, err := dns01.FindZoneByFqdn(info.EffectiveFQDN) if err != nil { - return fmt.Errorf("yandexcloud: could not find zone for domain %q (%s): %w", domain, info.EffectiveFQDN, err) + return fmt.Errorf("yandexcloud: could not find zone for domain %q: %w", domain, err) } ctx := context.Background() @@ -146,7 +146,7 @@ func (r *DNSProvider) CleanUp(domain, _, keyAuth string) error { authZone, err := dns01.FindZoneByFqdn(info.EffectiveFQDN) if err != nil { - return fmt.Errorf("yandexcloud: could not find zone for domain %q (%s): %w", domain, info.EffectiveFQDN, err) + return fmt.Errorf("yandexcloud: could not find zone for domain %q: %w", domain, err) } ctx := context.Background() diff --git a/providers/dns/zoneee/zoneee.go b/providers/dns/zoneee/zoneee.go index b0f0e5abb7..59dd0baf6e 100644 --- a/providers/dns/zoneee/zoneee.go +++ b/providers/dns/zoneee/zoneee.go @@ -126,7 +126,7 @@ func (d *DNSProvider) Present(domain, token, keyAuth string) error { authZone, err := dns01.FindZoneByFqdn(info.EffectiveFQDN) if err != nil { - return fmt.Errorf("zoneee: could not find zone for domain %q (%s): %w", domain, info.EffectiveFQDN, err) + return fmt.Errorf("zoneee: could not find zone for domain %q: %w", domain, err) } authZone = dns01.UnFqdn(authZone) @@ -144,7 +144,7 @@ func (d *DNSProvider) CleanUp(domain, token, keyAuth string) error { authZone, err := dns01.FindZoneByFqdn(info.EffectiveFQDN) if err != nil { - return fmt.Errorf("zoneee: could not find zone for domain %q (%s): %w", domain, info.EffectiveFQDN, err) + return fmt.Errorf("zoneee: could not find zone for domain %q: %w", domain, err) } authZone = dns01.UnFqdn(authZone)