mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2025-10-07 04:16:11 +08:00
DIGITALOCEAN: Adopt diff2 in compatibility mode (#1877)
This commit is contained in:
parent
f8fd853a02
commit
cc132b7268
1 changed files with 62 additions and 63 deletions
|
@ -147,10 +147,14 @@ func (api *digitaloceanProvider) GetDomainCorrections(dc *models.DomainConfig) (
|
|||
txtutil.SplitSingleLongTxt(dc.Records) // Autosplit long TXT records
|
||||
|
||||
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
|
||||
}
|
||||
|
@ -209,11 +213,6 @@ func (api *digitaloceanProvider) GetDomainCorrections(dc *models.DomainConfig) (
|
|||
corrections = append(corrections, corr)
|
||||
}
|
||||
|
||||
return corrections, nil
|
||||
}
|
||||
|
||||
// Insert Future diff2 version here.
|
||||
|
||||
return corrections, nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue