Skip to content

Commit

Permalink
Only log zone once for the SendMessage
Browse files Browse the repository at this point in the history
Signed-off-by: Greg Sidelinger <gate@ilive4code.net>
  • Loading branch information
gregsidelinger committed Dec 20, 2023
1 parent 1418a3a commit 7427c8e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion provider/rfc2136/rfc2136_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ func newStub() *rfc2136Stub {

func (r *rfc2136Stub) SendMessage(msg *dns.Msg) error {
zone := extractZoneFromMessage(msg.String())
log.Infof("zone=%s", zone)
lines := extractUpdateSectionFromMessage(msg)
for _, line := range lines {
// break at first empty line
Expand All @@ -58,7 +59,6 @@ func (r *rfc2136Stub) SendMessage(msg *dns.Msg) error {

line = strings.Replace(line, "\t", " ", -1)
log.Info(line)
log.Infof("zone=%s", zone)
record := strings.Split(line, " ")[0]
if !strings.HasSuffix(record, zone) {
return fmt.Errorf("Message contains updates outside of it's zone. zone=%v record=%v", zone, record)
Expand Down

0 comments on commit 7427c8e

Please sign in to comment.