AXFRDDNS: Adopt diff2 in compatibility mode
@@ -351,10 +351,14 @@ func (c *axfrddnsProvider) GetDomainCorrections(dc *models.DomainConfig) ([]*mod
txtutil.SplitSingleLongTxt(dc.Records) // Autosplit long TXT records
var corrections []*models.Correction
- if !diff2.EnableDiff2 || true { // Remove "|| true" when diff2 version arrives
-
+ var create, del, mod diff.Changeset
+ if !diff2.EnableDiff2 {
differ := diff.New(dc)
- _, create, del, mod, err := differ.IncrementalDiff(foundRecords)
+ _, create, del, mod, err = differ.IncrementalDiff(foundRecords)
+ } else {
+ differ := diff.NewCompat(dc)
+ _, create, del, mod, err = differ.IncrementalDiff(foundRecords)
+ }
if err != nil {
return nil, err
}
@@ -450,10 +454,6 @@ func (c *axfrddnsProvider) GetDomainCorrections(dc *models.DomainConfig) ([]*mod
},
})
}
- return corrections, nil
- }
-
- // Insert Future diff2 version here.
return corrections, nil
