From 6e786a9a314ec0725e70b96621ddd14a3883d94a Mon Sep 17 00:00:00 2001 From: Martin Weindel Date: Tue, 10 May 2022 15:02:02 +0200 Subject: [PATCH] fix domain name comparison in tryFixChanges --- pkg/controller/provider/aws/execution.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/controller/provider/aws/execution.go b/pkg/controller/provider/aws/execution.go index ef0b8d28c..5a68b1271 100644 --- a/pkg/controller/provider/aws/execution.go +++ b/pkg/controller/provider/aws/execution.go @@ -183,7 +183,7 @@ outer: switch *change.Change.Action { case route53.ChangeActionDelete: for _, m := range submatchNotFound { - if m[1] == *change.Change.ResourceRecordSet.Name && m[2] == *change.Change.ResourceRecordSet.Type { + if dns.NormalizeHostname(m[1]) == dns.NormalizeHostname(*change.Change.ResourceRecordSet.Name) && m[2] == *change.Change.ResourceRecordSet.Type { this.Infof("Ignoring already deleted record: %s (%s)", *change.Change.ResourceRecordSet.Name, *change.Change.ResourceRecordSet.Type) succeeded = append(succeeded, change) @@ -192,7 +192,7 @@ outer: } case route53.ChangeActionCreate: for _, m := range submatchExists { - if m[1] == *change.Change.ResourceRecordSet.Name && m[2] == *change.Change.ResourceRecordSet.Type { + if dns.NormalizeHostname(m[1]) == dns.NormalizeHostname(*change.Change.ResourceRecordSet.Name) && m[2] == *change.Change.ResourceRecordSet.Type { if this.isFetchedRecordSetEqual(change) { this.Infof("Ignoring already created record: %s (%s)", *change.Change.ResourceRecordSet.Name, *change.Change.ResourceRecordSet.Type) @@ -235,7 +235,7 @@ func (this *Execution) isFetchedRecordSetEqual(change *Change) bool { } crrs := change.Change.ResourceRecordSet orrs := output.ResourceRecordSets[0] - if *crrs.Name != *orrs.Name || *crrs.Type != *orrs.Type || !safeCompareInt64(crrs.TTL, orrs.TTL) || len(crrs.ResourceRecords) != len(orrs.ResourceRecords) { + if dns.NormalizeHostname(*crrs.Name) != dns.NormalizeHostname(*orrs.Name) || *crrs.Type != *orrs.Type || !safeCompareInt64(crrs.TTL, orrs.TTL) || len(crrs.ResourceRecords) != len(orrs.ResourceRecords) { return false } for i := range crrs.ResourceRecords {