HETZNER: Adopt diff2 in compatibility mode
@@ -103,10 +103,14 @@ func (api *hetznerProvider) GetDomainCorrections(dc *models.DomainConfig) ([]*mo
txtutil.SplitSingleLongTxt(dc.Records) // Autosplit long TXT records
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(existingRecords)
+ _, create, del, modify, err = differ.IncrementalDiff(existingRecords)
+ } else {
+ differ := diff.NewCompat(dc)
+ _, create, del, modify, err = differ.IncrementalDiff(existingRecords)
+ }
if err != nil {
return nil, err
}
@@ -166,11 +170,6 @@ func (api *hetznerProvider) GetDomainCorrections(dc *models.DomainConfig) ([]*mo
return corrections, nil
}
- // Insert Future diff2 version here.
-
- return corrections, nil
-}
-
// GetNameservers returns the nameservers for a domain.
func (api *hetznerProvider) GetNameservers(domain string) ([]*models.Nameserver, error) {
zone, err := api.getZone(domain)
