infomaniak: CNAME support (#1790)

Co-authored-by: Fernandez Ludovic <ldez@users.noreply.github.com>
This commit is contained in:
TeoGoddet 2022-12-24 02:24:11 +01:00 committed by GitHub
parent 339b62fdcd
commit a824cab316
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -112,10 +112,9 @@ func NewDNSProviderConfig(config *Config) (*DNSProvider, error) {
func (d *DNSProvider) Present(domain, token, keyAuth string) error {
fqdn, value := dns01.GetRecord(domain, keyAuth)
// TODO(ldez) replace domain by FQDN to follow CNAME.
ikDomain, err := d.client.GetDomainByName(domain)
ikDomain, err := d.client.GetDomainByName(dns01.UnFqdn(fqdn))
if err != nil {
return fmt.Errorf("infomaniak: could not get domain %q: %w", domain, err)
return fmt.Errorf("infomaniak: could not get domain %q: %w", fqdn, err)
}
d.domainIDsMu.Lock()
@ -168,7 +167,7 @@ func (d *DNSProvider) CleanUp(domain, token, keyAuth string) error {
err := d.client.DeleteDNSRecord(domainID, recordID)
if err != nil {
return fmt.Errorf("infomaniak: could not delete record %q: %w", domain, err)
return fmt.Errorf("infomaniak: could not delete record %q: %w", dns01.UnFqdn(fqdn), err)
}
// Delete record ID from map