Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strip trailing dot from zone so it matches dnsmadeeasy API response #5

Merged
merged 1 commit into from
Oct 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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