POWERDNS: Use canonical domain in calls to PowerDNS (#3080)

Co-authored-by: Tom Limoncelli <tlimoncelli@stackoverflow.com>
This commit is contained in:
Nikita Karamov 2024-08-21 20:13:56 +02:00 committed by GitHub
parent 94a0cfcba3
commit 8bb5df96bc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View file

@ -31,7 +31,7 @@ func (dsp *powerdnsProvider) getDiff2DomainCorrections(dc *models.DomainConfig,
corrections = append(corrections, &models.Correction{
Msg: change.MsgsJoined,
F: func() error {
return dsp.client.Zones().AddRecordSetToZone(context.Background(), dsp.ServerName, dc.Name, zones.ResourceRecordSet{
return dsp.client.Zones().AddRecordSetToZone(context.Background(), dsp.ServerName, canonical(dc.Name), zones.ResourceRecordSet{
Name: labelName,
Type: labelType,
TTL: labelTTL,
@ -44,7 +44,7 @@ func (dsp *powerdnsProvider) getDiff2DomainCorrections(dc *models.DomainConfig,
corrections = append(corrections, &models.Correction{
Msg: change.MsgsJoined,
F: func() error {
return dsp.client.Zones().RemoveRecordSetFromZone(context.Background(), dsp.ServerName, dc.Name, labelName, labelType)
return dsp.client.Zones().RemoveRecordSetFromZone(context.Background(), dsp.ServerName, canonical(dc.Name), labelName, labelType)
},
})
default:

View file

@ -20,7 +20,7 @@ func (dsp *powerdnsProvider) GetNameservers(string) ([]*models.Nameserver, error
// GetZoneRecords gets the records of a zone and returns them in RecordConfig format.
func (dsp *powerdnsProvider) GetZoneRecords(domain string, meta map[string]string) (models.Records, error) {
zone, err := dsp.client.Zones().GetZone(context.Background(), dsp.ServerName, domain)
zone, err := dsp.client.Zones().GetZone(context.Background(), dsp.ServerName, canonical(domain))
if err != nil {
return nil, err
}