Skip to content

Commit

Permalink
Strip trailing dot from zone so it matches dnsmadeeasy api response
Browse files Browse the repository at this point in the history
  • Loading branch information
coandco committed Oct 14, 2024
1 parent 6e8a0fe commit 9ec277c
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ func (p *Provider) GetRecords(ctx context.Context, zone string) ([]libdns.Record

var records []libdns.Record

// first, get the ID for our zone name
zoneId, err := p.client.IdForDomain(zone)
// first, get the ID for our zone name -- dnsmadeeasy doesn't use the trailing dot
zoneId, err := p.client.IdForDomain(strings.TrimRight(zone, "."))
if err != nil {
return nil, err
}
Expand All @@ -53,8 +53,8 @@ func (p *Provider) GetRecords(ctx context.Context, zone string) ([]libdns.Record
func createRecords(client dme.Client, zone string, records []libdns.Record) ([]libdns.Record, error) {
var dmeRecords []dme.Record

// first, get the ID for our zone name
zoneId, err := client.IdForDomain(zone)
// first, get the ID for our zone name -- dnsmadeeasy doesn't use the trailing dot
zoneId, err := client.IdForDomain(strings.TrimRight(zone, "."))
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -99,8 +99,8 @@ func (p *Provider) SetRecords(ctx context.Context, zone string, records []libdns
defer p.mutex.Unlock()
p.init(ctx)

// first, get the ID for our zone name
zoneId, err := p.client.IdForDomain(zone)
// first, get the ID for our zone name -- dnsmadeeasy doesn't use the trailing dot
zoneId, err := p.client.IdForDomain(strings.TrimRight(zone, "."))
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -165,8 +165,8 @@ func (p *Provider) DeleteRecords(ctx context.Context, zone string, records []lib
defer p.mutex.Unlock()
p.init(ctx)

// first, get the ID for our zone name
zoneId, err := p.client.IdForDomain(zone)
// first, get the ID for our zone name -- dnsmadeeasy doesn't use the trailing dot
zoneId, err := p.client.IdForDomain(strings.TrimRight(zone, "."))
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 9ec277c

Please sign in to comment.