dynu: fix subdomain support (#1842)
Co-authored-by: Fernandez Ludovic <ldez@users.noreply.github.com>
This commit is contained in:
parent
532788d42a
commit
1e2793f9ec
1 changed files with 3 additions and 5 deletions
|
@ -97,8 +97,7 @@ func (d *DNSProvider) Timeout() (timeout, interval time.Duration) {
|
|||
func (d *DNSProvider) Present(domain, token, keyAuth string) error {
|
||||
fqdn, value := dns01.GetRecord(domain, keyAuth)
|
||||
|
||||
// TODO(ldez) replace domain by FQDN to follow CNAME.
|
||||
rootDomain, err := d.client.GetRootDomain(domain)
|
||||
rootDomain, err := d.client.GetRootDomain(dns01.UnFqdn(fqdn))
|
||||
if err != nil {
|
||||
return fmt.Errorf("dynu: could not find root domain for %s: %w", domain, err)
|
||||
}
|
||||
|
@ -115,7 +114,7 @@ func (d *DNSProvider) Present(domain, token, keyAuth string) error {
|
|||
}
|
||||
}
|
||||
|
||||
subDomain, err := dns01.ExtractSubDomain(fqdn, domain)
|
||||
subDomain, err := dns01.ExtractSubDomain(fqdn, rootDomain.DomainName)
|
||||
if err != nil {
|
||||
return fmt.Errorf("dynu: %w", err)
|
||||
}
|
||||
|
@ -142,8 +141,7 @@ func (d *DNSProvider) Present(domain, token, keyAuth string) error {
|
|||
func (d *DNSProvider) CleanUp(domain, token, keyAuth string) error {
|
||||
fqdn, value := dns01.GetRecord(domain, keyAuth)
|
||||
|
||||
// TODO(ldez) replace domain by FQDN to follow CNAME.
|
||||
rootDomain, err := d.client.GetRootDomain(domain)
|
||||
rootDomain, err := d.client.GetRootDomain(dns01.UnFqdn(fqdn))
|
||||
if err != nil {
|
||||
return fmt.Errorf("dynu: could not find root domain for %s: %w", domain, err)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue