mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2025-09-14 00:54:24 +08:00
CLOUDNS: Adopt diff2 in compatibility mode (#1874)
This commit is contained in:
parent
bdeeb2cf1b
commit
4eab96226c
1 changed files with 70 additions and 72 deletions
|
@ -105,9 +105,12 @@ func (c *cloudnsProvider) GetDomainCorrections(dc *models.DomainConfig) ([]*mode
|
||||||
}
|
}
|
||||||
|
|
||||||
var corrections []*models.Correction
|
var corrections []*models.Correction
|
||||||
if !diff2.EnableDiff2 || true { // Remove "|| true" when diff2 version arrives
|
var differ diff.Differ
|
||||||
|
if !diff2.EnableDiff2 {
|
||||||
differ := diff.New(dc)
|
differ = diff.New(dc)
|
||||||
|
} else {
|
||||||
|
differ = diff.NewCompat(dc)
|
||||||
|
}
|
||||||
_, create, del, modify, err := differ.IncrementalDiff(existingRecords)
|
_, create, del, modify, err := differ.IncrementalDiff(existingRecords)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
@ -184,11 +187,6 @@ func (c *cloudnsProvider) GetDomainCorrections(dc *models.DomainConfig) ([]*mode
|
||||||
corrections = append(corrections, corr)
|
corrections = append(corrections, corr)
|
||||||
}
|
}
|
||||||
|
|
||||||
return corrections, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// Insert Future diff2 version here.
|
|
||||||
|
|
||||||
return corrections, nil
|
return corrections, nil
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue