mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2025-09-08 06:04:24 +08:00
POWERDNS: Adopt diff2 in compatibility mode (#1899)
This commit is contained in:
parent
81f75ed154
commit
b4cbd1299f
2 changed files with 58 additions and 60 deletions
|
@ -228,7 +228,7 @@ func toRc(dc *models.DomainConfig, r *domainRecord) *models.RecordConfig {
|
|||
|
||||
switch rtype := r.Type; rtype { // #rtype_variations
|
||||
case "TXT":
|
||||
rc.SetTargetTXTString(r.Value)
|
||||
rc.SetTargetTXT(r.Value)
|
||||
case "SRV":
|
||||
spl := strings.Split(r.Value, " ")
|
||||
prio, _ := strconv.ParseUint(spl[0], 10, 16)
|
||||
|
|
|
@ -62,11 +62,13 @@ func (dsp *powerdnsProvider) GetDomainCorrections(dc *models.DomainConfig) ([]*m
|
|||
}
|
||||
models.PostProcessRecords(curRecords)
|
||||
|
||||
var corrections []*models.Correction
|
||||
if !diff2.EnableDiff2 || true { // Remove "|| true" when diff2 version arrives
|
||||
|
||||
// create record diff by group
|
||||
keysToUpdate, err := (diff.New(dc)).ChangedGroups(curRecords)
|
||||
var keysToUpdate map[models.RecordKey][]string
|
||||
if !diff2.EnableDiff2 {
|
||||
keysToUpdate, err = (diff.New(dc)).ChangedGroups(curRecords)
|
||||
} else {
|
||||
keysToUpdate, err = (diff.NewCompat(dc)).ChangedGroups(curRecords)
|
||||
}
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -115,6 +117,7 @@ func (dsp *powerdnsProvider) GetDomainCorrections(dc *models.DomainConfig) ([]*m
|
|||
|
||||
// append corrections in the right order
|
||||
// delete corrections must be run first to avoid correlations with existing RR
|
||||
var corrections []*models.Correction
|
||||
corrections = append(corrections, dCorrections...)
|
||||
corrections = append(corrections, cuCorrections...)
|
||||
|
||||
|
@ -125,11 +128,6 @@ func (dsp *powerdnsProvider) GetDomainCorrections(dc *models.DomainConfig) ([]*m
|
|||
}
|
||||
corrections = append(corrections, dnssecCorrections...)
|
||||
|
||||
return corrections, nil
|
||||
}
|
||||
|
||||
// Insert Future diff2 version here.
|
||||
|
||||
return corrections, nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue