mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2025-12-17 22:28:29 +08:00
LINODE: Adopt diff2 in compatibility mode (#1892)
This commit is contained in:
parent
1ab73aad37
commit
b6ee7161a5
2 changed files with 64 additions and 63 deletions
|
|
@ -14,5 +14,7 @@ func AuditRecords(records []*models.RecordConfig) []error {
|
|||
|
||||
a.Add("CAA", rejectif.CaaFlagIsNonZero) // Last verified 2022-03-25
|
||||
|
||||
a.Add("CAA", rejectif.CaaTargetContainsWhitespace) // Last verified 2023-01-15
|
||||
|
||||
return a.Audit(records)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -157,10 +157,14 @@ func (api *linodeProvider) GetDomainCorrections(dc *models.DomainConfig) ([]*mod
|
|||
}
|
||||
|
||||
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
|
||||
}
|
||||
|
|
@ -226,11 +230,6 @@ func (api *linodeProvider) GetDomainCorrections(dc *models.DomainConfig) ([]*mod
|
|||
return corrections, nil
|
||||
}
|
||||
|
||||
// Insert Future diff2 version here.
|
||||
|
||||
return corrections, nil
|
||||
}
|
||||
|
||||
func (api *linodeProvider) getRecordsForDomain(domainID int, domain string) (models.Records, error) {
|
||||
records, err := api.getRecords(domainID)
|
||||
if err != nil {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue