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

CHORE: More cleanups (#2632)

This commit is contained in:
Tom Limoncelli
2023-11-19 13:44:49 -05:00
committed by GitHub
parent 159fdf07ad
commit 3dab594757
9 changed files with 38 additions and 15 deletions

View File

@@ -4,7 +4,6 @@ import (
"bytes"
"encoding/json"
"fmt"
"sort"
"github.com/StackExchange/dnscontrol/v4/models"
"github.com/StackExchange/dnscontrol/v4/pkg/diff"
@@ -237,7 +236,7 @@ func (c *desecProvider) GetZoneRecordsCorrections(dc *models.DomainConfig, exist
// However the code doesn't seem to have such situation. All tests
// pass. That said, if this breaks anything, the easiest fix might
// be to just remove the sort.
sort.Slice(corrections, func(i, j int) bool { return diff.CorrectionLess(corrections, i, j) })
//sort.Slice(corrections, func(i, j int) bool { return diff.CorrectionLess(corrections, i, j) })
return corrections, nil
}

View File

@@ -1,10 +1,18 @@
package powerdns
import "github.com/StackExchange/dnscontrol/v4/models"
import (
"github.com/StackExchange/dnscontrol/v4/models"
"github.com/StackExchange/dnscontrol/v4/pkg/rejectif"
)
// AuditRecords returns a list of errors corresponding to the records
// that aren't supported by this provider. If all records are
// supported, an empty list is returned.
func AuditRecords(records []*models.RecordConfig) []error {
return nil
a := rejectif.Auditor{}
a.Add("TXT", rejectif.TxtHasDoubleQuotes) // Last verified 2023-11-11
a.Add("TXT", rejectif.TxtHasBackslash) // Last verified 2023-11-11
return a.Audit(records)
}

View File

@@ -10,10 +10,14 @@ import (
// supported, an empty list is returned.
func AuditRecords(records []*models.RecordConfig) []error {
a := rejectif.Auditor{}
a.Add("MX", rejectif.MxNull) // Last verified 2023-01-28
a.Add("TXT", rejectif.TxtHasBackticks) // Last verified 2023-01-28
a.Add("MX", rejectif.MxNull) // Last verified 2023-01-28
a.Add("TXT", rejectif.TxtHasBackticks) // Last verified 2023-01-28
a.Add("TXT", rejectif.TxtHasTrailingSpace) // Last verified 2023-01-28
a.Add("TXT", rejectif.TxtIsEmpty) // Last verified 2023-01-28
a.Add("TXT", rejectif.TxtIsEmpty) // Last verified 2023-01-28
return a.Audit(records)
}