Skip to content

Commit

Permalink
Look at TTL when comparing rrsets.
Browse files Browse the repository at this point in the history
  • Loading branch information
gerrowadat committed Nov 5, 2023
1 parent fa1c3b6 commit 917aa45
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
3 changes: 2 additions & 1 deletion clouddns.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
15 changes: 15 additions & 0 deletions clouddns_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down

0 comments on commit 917aa45

Please sign in to comment.