Fix record not being found when updating it
This commit is contained in:
parent
ab4c4a2c9e
commit
8a738c041b
@ -83,14 +83,20 @@ func (p *Provider) updateDNSRecord(ctx context.Context, domain string, record li
|
|||||||
|
|
||||||
p.getClient()
|
p.getClient()
|
||||||
|
|
||||||
|
id, err := strconv.Atoi(record.ID)
|
||||||
|
if err != nil {
|
||||||
|
return record, err
|
||||||
|
}
|
||||||
|
|
||||||
entry := govultr.DNSRecord{
|
entry := govultr.DNSRecord{
|
||||||
Name: record.Name,
|
Name: record.Name,
|
||||||
Data: record.Value,
|
Data: record.Value,
|
||||||
Type: record.Type,
|
Type: record.Type,
|
||||||
TTL: int(record.TTL.Seconds()),
|
TTL: int(record.TTL.Seconds()),
|
||||||
|
RecordID: id,
|
||||||
}
|
}
|
||||||
|
|
||||||
err := p.client.DNSRecord.Update(ctx, domain, &entry)
|
err = p.client.DNSRecord.Update(ctx, domain, &entry)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return record, err
|
return record, err
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user