diff --git a/plan/plan.go b/plan/plan.go index 43a327c53..617d2c431 100644 --- a/plan/plan.go +++ b/plan/plan.go @@ -87,13 +87,13 @@ func (changes *Changes) MarshalJSON() ([]byte, error) { }) } -func MkUpdates(old []*endpoint.Endpoint, new []*endpoint.Endpoint) ([]*Update, error) { +func MkUpdates(olds []*endpoint.Endpoint, news []*endpoint.Endpoint) ([]*Update, error) { updates := []*Update{} - if nOld, nNew := len(old), len(new); nOld != nNew { - return nil, fmt.Errorf("Number of old updates (%v) does not match number of new updates (%v)", nOld, nNew) + if nOld, nNew := len(olds), len(news); nOld != nNew { + return nil, fmt.Errorf("number of old updates (%v) does not match number of new updates (%v)", nOld, nNew) } - for i, old := range old { - updates = append(updates, &Update{Old: old, New: new[i]}) + for i, old := range olds { + updates = append(updates, &Update{Old: old, New: news[i]}) } return updates, nil } diff --git a/provider/exoscale/exoscale.go b/provider/exoscale/exoscale.go index 7ece62eed..1d9b75ee1 100644 --- a/provider/exoscale/exoscale.go +++ b/provider/exoscale/exoscale.go @@ -304,7 +304,6 @@ func (f *zoneFilter) EndpointZoneID(endpoint *endpoint.Endpoint, zones map[strin func merge(updates []*plan.Update) []*endpoint.Endpoint { var result []*endpoint.Endpoint for _, update := range updates { - if !update.New.Targets.Same(update.Old.Targets) { // new target: always update, TTL will be overwritten too if necessary result = append(result, update.New) diff --git a/registry/txt.go b/registry/txt.go index 80515e97a..4d7e091e4 100644 --- a/registry/txt.go +++ b/registry/txt.go @@ -284,8 +284,8 @@ func (im *TXTRegistry) ApplyChanges(ctx context.Context, changes *plan.Changes) // when we update old TXT records for which value has changed (due to new label) this would still work because // !!! TXT record value is uniquely generated from the Labels of the endpoint. Hence old TXT record can be uniquely reconstructed // NOTE: Whether `generateTXTRecord` returns `nil` depends only on DNSName, which will be the same for `old` and `new` - if old, new := im.generateTXTRecord(r.Old), im.generateTXTRecord(r.New); old != nil && new != nil { - filteredChanges.Update = append(filteredChanges.Update, &plan.Update{Old: old, New: new}) + if old, new_ := im.generateTXTRecord(r.Old), im.generateTXTRecord(r.New); old != nil && new_ != nil { + filteredChanges.Update = append(filteredChanges.Update, &plan.Update{Old: old, New: new_}) } if im.cacheInterval > 0 { // remove old version of record from cache