mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2025-10-09 21:36:22 +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
|
txtutil.SplitSingleLongTxt(dc.Records) // Autosplit long TXT records
|
||||||
|
|
||||||
var corrections []*models.Correction
|
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)
|
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 {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
@ -212,11 +216,6 @@ func (api *digitaloceanProvider) GetDomainCorrections(dc *models.DomainConfig) (
|
||||||
return corrections, nil
|
return corrections, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Insert Future diff2 version here.
|
|
||||||
|
|
||||||
return corrections, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func getRecords(api *digitaloceanProvider, name string) ([]godo.DomainRecord, error) {
|
func getRecords(api *digitaloceanProvider, name string) ([]godo.DomainRecord, error) {
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue