INWX: Adopt diff2 in compatibility mode
@@ -242,15 +242,19 @@ func (api *inwxAPI) GetDomainCorrections(dc *models.DomainConfig) ([]*models.Cor
return nil, err
}
+ var corrections []*models.Correction
+ var create, del, mod diff.Changeset
+ if !diff2.EnableDiff2 {
differ := diff.New(dc)
- _, create, del, mod, err := differ.IncrementalDiff(foundRecords)
+ _, create, del, mod, err = differ.IncrementalDiff(foundRecords)
+ } else {
+ differ := diff.NewCompat(dc)
+ _, create, del, mod, err = differ.IncrementalDiff(foundRecords)
+ }
if err != nil {
return nil, err
}
- var corrections []*models.Correction
- if !diff2.EnableDiff2 || true { // Remove "|| true" when diff2 version arrives
-
for _, d := range create {
des := d.Desired
corrections = append(corrections, &models.Correction{
@@ -277,11 +281,6 @@ func (api *inwxAPI) GetDomainCorrections(dc *models.DomainConfig) ([]*models.Cor
return corrections, nil
}
- // Insert Future diff2 version here.
-
- return corrections, nil
-}
-
// getDefaultNameservers returns string map with default nameservers based on e.g. sandbox mode.
func (api *inwxAPI) getDefaultNameservers() []string {
if api.sandbox {
