mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2024-05-11 05:55:12 +00:00
BIND: Improve SOA serial number handling (#651)
* github.com/miekg/dns * Greatly simplify the logic for handling serial numbers. Related code was all over the place. Now it is abstracted into one testable method makeSoa. This simplifies code in many other places. * Update docs/_providers/bind.md: Edit old text. Add SOA description. * SOA records are now treated like any other record internally. You still can't specify them in dnsconfig.js, but that's by design. * The URL for issue 491 was wrong in many places * BIND: Clarify GENERATE_ZONEFILE message
This commit is contained in:
@ -54,6 +54,9 @@ func (d *differ) content(r *models.RecordConfig) string {
|
||||
// its output with r.GetTargetDiffable() to make sure the same
|
||||
// results are generated. Once we have confidence, this function will go away.
|
||||
content := fmt.Sprintf("%v ttl=%d", r.GetTargetCombined(), r.TTL)
|
||||
if r.Type == "SOA" {
|
||||
content = fmt.Sprintf("%s %v %d %d %d %d ttl=%d", r.Target, r.SoaMbox, r.SoaRefresh, r.SoaRetry, r.SoaExpire, r.SoaMinttl, r.TTL) // SoaSerial is not used in comparison
|
||||
}
|
||||
var allMaps []map[string]string
|
||||
for _, f := range d.extraValues {
|
||||
// sort the extra values map keys to perform a deterministic
|
||||
@ -72,6 +75,7 @@ func (d *differ) content(r *models.RecordConfig) string {
|
||||
}
|
||||
control := r.ToDiffable(allMaps...)
|
||||
if control != content {
|
||||
fmt.Printf("CONTROL=%q CONTENT=%q\n", control, content)
|
||||
panic("OOPS! control != content")
|
||||
}
|
||||
return content
|
||||
|
@ -263,7 +263,7 @@ func TestInvalidGlobIgnoredRecord(t *testing.T) {
|
||||
checkLengthsFull(t, existing, desired, 0, 1, 0, 0, false, []string{"www1", "www2", "[.www3"})
|
||||
}
|
||||
|
||||
// from https://github.com/StackExchange/dnscontrol/v2/issues/552
|
||||
// from https://github.com/StackExchange/dnscontrol/issues/552
|
||||
func TestCaas(t *testing.T) {
|
||||
existing := []*models.RecordConfig{
|
||||
myRecord("test CAA 1 1.1.1.1"),
|
||||
|
Reference in New Issue
Block a user