Skip to content

Commit

Permalink
POWERDNS: Use canonical domain in calls to PowerDNS (#3080)
Browse files Browse the repository at this point in the history
Co-authored-by: Tom Limoncelli <tlimoncelli@stackoverflow.com>
  • Loading branch information
kytta and tlimoncelli authored Aug 21, 2024
1 parent 94a0cfc commit 8bb5df9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions providers/powerdns/diff.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion providers/powerdns/dns.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 8bb5df9

Please sign in to comment.