DNSIMPLE: Adopt diff2 in compatibility mode
@@ -165,10 +165,18 @@ func (c *dnsimpleProvider) GetDomainCorrections(dc *models.DomainConfig) ([]*mod
// Normalize
models.PostProcessRecords(actual)
- if !diff2.EnableDiff2 || true { // Remove "|| true" when diff2 version arrives
-
+ var create, del, modify diff.Changeset
+ if !diff2.EnableDiff2 {
differ := diff.New(dc)
- _, create, del, modify, err := differ.IncrementalDiff(actual)
+ _, create, del, modify, err = differ.IncrementalDiff(actual)
+ } else {
+ differ := diff.NewCompat(dc)
+ _, create, del, modify, err = differ.IncrementalDiff(actual)
+ }
+ if err != nil {
+ return nil, err
+ }
+
if err != nil {
return nil, err
}
@@ -201,11 +209,6 @@ func (c *dnsimpleProvider) GetDomainCorrections(dc *models.DomainConfig) ([]*mod
return corrections, nil
}
- // Insert Future diff2 version here.
-
- return corrections, nil
-}
-
func removeApexNS(records models.Records) models.Records {
var filtered models.Records
for _, r := range records {
