DESEC: Adopt diff2 in compatibility mode
@@ -166,14 +166,20 @@ func PrepDesiredRecords(dc *models.DomainConfig, minTTL uint32) {
func (c *desecProvider) GenerateDomainCorrections(dc *models.DomainConfig, existing models.Records) ([]*models.Correction, error) {
var corrections []*models.Correction
- if !diff2.EnableDiff2 || true { // Remove "|| true" when diff2 version arrives
-
+ var err error
+ var keysToUpdate map[models.RecordKey][]string
+ if !diff2.EnableDiff2 {
// diff existing vs. current.
differ := diff.New(dc)
- keysToUpdate, err := differ.ChangedGroups(existing)
+ keysToUpdate, err = differ.ChangedGroups(existing)
+ } else {
+ differ := diff.NewCompat(dc)
+ keysToUpdate, err = differ.ChangedGroups(existing)
+ }
if err != nil {
return nil, err
}
+
if len(keysToUpdate) == 0 {
return nil, nil
}
@@ -245,9 +251,3 @@ func (c *desecProvider) GenerateDomainCorrections(dc *models.DomainConfig, exist
return corrections, nil
}
-
- // Insert Future diff2 version here.
-
- // Insert Future diff2 version here.
- return corrections, nil
-}
