From 917aa45e1162d9593504d4955425f88b33679fcd Mon Sep 17 00:00:00 2001 From: Dave O'Connor Date: Sun, 5 Nov 2023 23:19:51 +0000 Subject: [PATCH] Look at TTL when comparing rrsets. --- clouddns.go | 3 ++- clouddns_test.go | 15 +++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/clouddns.go b/clouddns.go index b2eb691..8846cf7 100644 --- a/clouddns.go +++ b/clouddns.go @@ -92,7 +92,8 @@ func dumpZonefile(dnsSpec *CloudDNSSpec) { func rrsetsEqual(x *dns.ResourceRecordSet, y *dns.ResourceRecordSet) bool { if x.Type != y.Type || - x.Name != y.Name { + x.Name != y.Name || + x.Ttl != y.Ttl { return false } diff --git a/clouddns_test.go b/clouddns_test.go index 27e847e..a8113e0 100644 --- a/clouddns_test.go +++ b/clouddns_test.go @@ -52,6 +52,21 @@ func Test_rrsetsEqual(t *testing.T) { }, want: false, }, + { + name: "DifferingTtl", + args: args{ + x: &dns.ResourceRecordSet{ + Type: "A", + Name: "hostname.example.com", + Ttl: 60, + }, + y: &dns.ResourceRecordSet{ + Type: "A", + Name: "hostname.example.com", + }, + }, + want: false, + }, { name: "DifferingRRdatas_len", args: args{