Change the ID of the record added to the ID returned by the API
This commit is contained in:
parent
a8fa24426b
commit
1448b1a6dd
11
client.go
11
client.go
@ -76,18 +76,15 @@ func (p *Provider) addDNSRecord(ctx context.Context, domain string, record libdn
|
|||||||
Data: strconv.Quote(record.Value),
|
Data: strconv.Quote(record.Value),
|
||||||
TTL: int(record.TTL.Seconds()),
|
TTL: int(record.TTL.Seconds()),
|
||||||
}
|
}
|
||||||
|
|
||||||
rec, err := p.client.vultr.DomainRecord.Create(ctx, domain, domainRecordReq)
|
rec, err := p.client.vultr.DomainRecord.Create(ctx, domain, domainRecordReq)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return record, err
|
return record, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return libdns.Record{
|
record.ID = rec.ID
|
||||||
Name: rec.Name,
|
|
||||||
Type: rec.Type,
|
return record, nil
|
||||||
Value: rec.Data,
|
|
||||||
TTL: time.Duration(rec.TTL) * time.Second,
|
|
||||||
ID: rec.ID,
|
|
||||||
}, nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *Provider) removeDNSRecord(ctx context.Context, domain string, record libdns.Record) (libdns.Record, error) {
|
func (p *Provider) removeDNSRecord(ctx context.Context, domain string, record libdns.Record) (libdns.Record, error) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user