EXOSCALE: Adopt diff2 in compatibility mode
@@ -191,10 +191,14 @@ func (c *exoscaleProvider) GetDomainCorrections(dc *models.DomainConfig) ([]*mod
models.PostProcessRecords(existingRecords)
var corrections []*models.Correction
- if !diff2.EnableDiff2 || true { // Remove "|| true" when diff2 version arrives
-
+ var create, delete, modify diff.Changeset
+ if !diff2.EnableDiff2 {
differ := diff.New(dc)
- _, create, delete, modify, err := differ.IncrementalDiff(existingRecords)
+ _, create, delete, modify, err = differ.IncrementalDiff(existingRecords)
+ } else {
+ differ := diff.NewCompat(dc)
+ _, create, delete, modify, err = differ.IncrementalDiff(existingRecords)
+ }
if err != nil {
return nil, err
}
@@ -227,11 +231,6 @@ func (c *exoscaleProvider) GetDomainCorrections(dc *models.DomainConfig) ([]*mod
return corrections, nil
}
- // Insert Future diff2 version here.
-
- return corrections, nil
-}
-
// Returns a function that can be invoked to create a record in a zone.
func (c *exoscaleProvider) createRecordFunc(rc *models.RecordConfig, domainID string) func() error {
return func() error {
