NETLIFY: Adopt diff2 in compatibility mode
@@ -194,10 +194,14 @@ func (n *netlifyProvider) GetDomainCorrections(dc *models.DomainConfig) ([]*mode
removeOtherApexNS(dc)
var corrections []*models.Correction
- 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(records)
+ _, create, del, modify, err = differ.IncrementalDiff(records)
+ } else {
+ differ := diff.NewCompat(dc)
+ _, create, del, modify, err = differ.IncrementalDiff(records)
+ }
if err != nil {
return nil, err
}
@@ -251,11 +255,6 @@ func (n *netlifyProvider) GetDomainCorrections(dc *models.DomainConfig) ([]*mode
return corrections, nil
}
- // Insert Future diff2 version here.
-
- return corrections, nil
-}
-
func toReq(rc *models.RecordConfig) *dnsRecordCreate {
name := rc.GetLabelFQDN() // Netlify wants the FQDN
target := rc.GetTargetField()
