nifcloud: fix bug in case of same auth zone (#2125)
Co-authored-by: Fernandez Ludovic <ldez@users.noreply.github.com>
This commit is contained in:
parent
6933296e2f
commit
82e9a5e2a9
1 changed files with 8 additions and 5 deletions
|
@ -131,7 +131,15 @@ func (d *DNSProvider) Timeout() (timeout, interval time.Duration) {
|
|||
}
|
||||
|
||||
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: %w", err)
|
||||
}
|
||||
|
||||
name := dns01.UnFqdn(fqdn)
|
||||
if authZone == fqdn {
|
||||
name = "@"
|
||||
}
|
||||
|
||||
reqParams := internal.ChangeResourceRecordSetsRequest{
|
||||
XMLNs: internal.XMLNs,
|
||||
|
@ -159,11 +167,6 @@ 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: %w", err)
|
||||
}
|
||||
|
||||
ctx := context.Background()
|
||||
|
||||
resp, err := d.client.ChangeResourceRecordSets(ctx, dns01.UnFqdn(authZone), reqParams)
|
||||
|
|
Loading…
Reference in a new issue