This commit is contained in:
David Dymko 2020-06-19 09:05:30 -04:00
parent 539284ff93
commit bc068913d0

View File

@ -157,17 +157,17 @@ func (p *VultrProvider) submitChanges(ctx context.Context, changes []*VultrChang
for zoneName, changes := range zoneChanges { for zoneName, changes := range zoneChanges {
for _, change := range changes { for _, change := range changes {
log.WithFields(log.Fields{ log.WithFields(log.Fields{
"record": change.ResourceRecordSet.Name, "record": change.ResourceRecordSet.Name,
"type": change.ResourceRecordSet.Type, "type": change.ResourceRecordSet.Type,
"ttl": change.ResourceRecordSet.TTL, "ttl": change.ResourceRecordSet.TTL,
"priority": change.ResourceRecordSet.Priority, "priority": change.ResourceRecordSet.Priority,
"action": change.Action, "action": change.Action,
"zone": zoneName, "zone": zoneName,
}).Info("Changing record.") }).Info("Changing record.")
switch change.Action { switch change.Action {
case vultrCreate: case vultrCreate:
priority := getPriority(change.ResourceRecordSet.Priority) priority := getPriority(change.ResourceRecordSet.Priority)
err = p.client.DNSRecord.Create(ctx, zoneName, change.ResourceRecordSet.Type, change.ResourceRecordSet.Name, change.ResourceRecordSet.Data, change.ResourceRecordSet.TTL, priority) err = p.client.DNSRecord.Create(ctx, zoneName, change.ResourceRecordSet.Type, change.ResourceRecordSet.Name, change.ResourceRecordSet.Data, change.ResourceRecordSet.TTL, priority)
if err != nil { if err != nil {
return err return err
@ -281,8 +281,8 @@ func (p *VultrProvider) getRecordID(ctx context.Context, zone string, record gov
func getPriority(priority *int) int { func getPriority(priority *int) int {
p := 0 p := 0
if priority != nil{ if priority != nil {
p = *priority p = *priority
} }
return p return p
} }