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

Add TTL to BIND SoaInfo struct (#820)

Co-authored-by: Kevin Zander <Kevin.Zander@sony.com>
This commit is contained in:
Kevin Zander
2020-08-20 14:44:15 -05:00
committed by GitHub
parent b328bb1b2e
commit 79357bb667
3 changed files with 10 additions and 9 deletions

View File

@ -9,7 +9,6 @@ func makeSoa(origin string, defSoa *SoaInfo, existing, desired *models.RecordCon
// or hardcoded defaults.
soaRec := models.RecordConfig{}
soaRec.SetLabel("@", origin)
soaRec.TTL = models.DefaultTTL
if defSoa == nil {
defSoa = &SoaInfo{}
@ -22,6 +21,7 @@ func makeSoa(origin string, defSoa *SoaInfo, existing, desired *models.RecordCon
desired = &models.RecordConfig{}
}
soaRec.TTL = firstNonZero(desired.TTL, defSoa.TTL, existing.TTL, models.DefaultTTL)
soaRec.SetTargetSOA(
firstNonNull(desired.GetTargetField(), existing.GetTargetField(), defSoa.Ns, "DEFAULT_NOT_SET."),
firstNonNull(desired.SoaMbox, existing.SoaMbox, defSoa.Mbox, "DEFAULT_NOT_SET."),