1
0
mirror of https://github.com/StackExchange/dnscontrol.git synced 2024-05-11 05:55:12 +00:00

LINODE: Adopt diff2 in compatibility mode (#1892)

This commit is contained in:
Tom Limoncelli
2023-01-18 08:42:22 -05:00
committed by GitHub
parent 1ab73aad37
commit b6ee7161a5
2 changed files with 64 additions and 63 deletions

View File

@@ -14,5 +14,7 @@ func AuditRecords(records []*models.RecordConfig) []error {
a.Add("CAA", rejectif.CaaFlagIsNonZero) // Last verified 2022-03-25 a.Add("CAA", rejectif.CaaFlagIsNonZero) // Last verified 2022-03-25
a.Add("CAA", rejectif.CaaTargetContainsWhitespace) // Last verified 2023-01-15
return a.Audit(records) return a.Audit(records)
} }

View File

@@ -157,10 +157,14 @@ func (api *linodeProvider) GetDomainCorrections(dc *models.DomainConfig) ([]*mod
} }
var corrections []*models.Correction 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) 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 { if err != nil {
return nil, err return nil, err
} }
@@ -226,11 +230,6 @@ func (api *linodeProvider) GetDomainCorrections(dc *models.DomainConfig) ([]*mod
return corrections, nil return corrections, nil
} }
// Insert Future diff2 version here.
return corrections, nil
}
func (api *linodeProvider) getRecordsForDomain(domainID int, domain string) (models.Records, error) { func (api *linodeProvider) getRecordsForDomain(domainID int, domain string) (models.Records, error) {
records, err := api.getRecords(domainID) records, err := api.getRecords(domainID)
if err != nil { if err != nil {