ORACLE: Adopt diff2 in compatibility mode
@@ -241,10 +241,18 @@ func (o *oracleProvider) GetDomainCorrections(dc *models.DomainConfig) ([]*model
}
var corrections []*models.Correction
- if !diff2.EnableDiff2 || true { // Remove "|| true" when diff2 version arrives
-
+ var create, dels, modify diff.Changeset
+ if !diff2.EnableDiff2 {
differ := diff.New(dc)
- _, create, dels, modify, err := differ.IncrementalDiff(existingRecords)
+ _, create, dels, modify, err = differ.IncrementalDiff(existingRecords)
+ } else {
+ differ := diff.NewCompat(dc)
+ _, create, dels, modify, err = differ.IncrementalDiff(existingRecords)
+ }
+ if err != nil {
+ return nil, err
+ }
+
if err != nil {
return nil, err
}
@@ -313,11 +321,6 @@ func (o *oracleProvider) GetDomainCorrections(dc *models.DomainConfig) ([]*model
return corrections, nil
}
- // Insert Future diff2 version here.
-
- return corrections, nil
-}
-
func (o *oracleProvider) patch(createRecords, deleteRecords models.Records, domain string) error {
ctx, cancel := context.WithTimeout(context.Background(), time.Minute)
defer cancel()
