mirror of
https://github.com/coredns/coredns.git
synced 2026-03-11 08:13:12 -04:00
feat(secondary): Send NOTIFY messages after zone transfer (#7901)
* feat(secondary): Send NOTIFY messages after zone transfer - Modified TransferIn() method to accept a transfer.Transfer parameter - Added NOTIFY message sending after successful zone transfer in secondary plugin - Updated Update() method to pass the transfer handler through the zone update cycle - Added comprehensive tests for the secondary notify functionality Closes #5669 Signed-off-by: liucongran <liucongran327@gmail.com> * fix(secondary): Fix TransferIn method call in test Update test to pass nil parameter to TransferIn method after signature change Signed-off-by: liucongran <liucongran327@gmail.com> * refactor(secondary): Clean up imports and add helper methods - Reorder imports for consistency - Add hasSOA() and getSOA() helper methods to Zone - Remove unnecessary blank lines in tests Signed-off-by: liucongran <liucongran327@gmail.com> * fix(test): Fix variable declaration in secondary test Change corefile variable assignment to use short declaration syntax (:=) to fix compilation error. Signed-off-by: liucongran <liucongran327@gmail.com> * refactor(secondary): Use getSOA helper method in shouldTransfer Replace direct SOA access with getSOA() helper method for consistency. Signed-off-by: liucongran <liucongran327@gmail.com> --------- Signed-off-by: liucongran <liucongran327@gmail.com> Co-authored-by: liucongran <liucongran@cestc.cn>
This commit is contained in:
@@ -182,3 +182,15 @@ func (z *Zone) nameFromRight(qname string, i int) (string, bool) {
|
||||
}
|
||||
return qname[n:], false
|
||||
}
|
||||
|
||||
func (z *Zone) hasSOA() bool {
|
||||
z.RLock()
|
||||
defer z.RUnlock()
|
||||
return z.SOA != nil
|
||||
}
|
||||
|
||||
func (z *Zone) getSOA() *dns.SOA {
|
||||
z.RLock()
|
||||
defer z.RUnlock()
|
||||
return z.SOA
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user