acme-dns: continue the process when the CNAME is handled by the storage (#2443)

This commit is contained in:
Ludovic Fernandez 2025-02-17 16:00:22 +01:00 committed by GitHub
commit f9c1e241f3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -172,14 +172,16 @@ func (d *DNSProvider) Present(domain, _, keyAuth string) error {
// Check if credentials were previously saved for this domain.
account, err := d.storage.Fetch(ctx, domain)
if err != nil {
if errors.Is(err, storage.ErrDomainNotFound) {
// The account did not exist.
// Create a new one and return an error indicating the required one-time manual CNAME setup.
return d.register(ctx, domain, info.FQDN)
if !errors.Is(err, storage.ErrDomainNotFound) {
return err
}
// Errors other than goacmedns.ErrDomainNotFound are unexpected.
return err
// The account did not exist.
// Create a new one and return an error indicating the required one-time manual CNAME setup.
err = d.register(ctx, domain, info.FQDN)
if err != nil {
return err
}
}
// Update the acme-dns TXT record.