Skip to content

Commit

Permalink
fix domain name comparison in tryFixChanges
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinWeindel committed May 10, 2022
1 parent ace2c52 commit 6e786a9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/controller/provider/aws/execution.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 6e786a9

Please sign in to comment.