Skip to content

Commit

Permalink
Group By Endpoint names per Hosted Zone on AWS
Browse files Browse the repository at this point in the history
  • Loading branch information
leonardocaylent committed Mar 3, 2024
1 parent e55200a commit 7c7a1c3
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions provider/aws/aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -995,12 +995,12 @@ func changesByZone(zones map[string]*route53.HostedZone, changeSet Route53Change
}
for _, z := range zones {
// Initialize the map for the Current Zone & Record Type if it doesn't exist
if visitedHostnames[aws.StringValue(z.Id)][c.ResourceRecordSet.Type] == nil {
visitedHostnames[aws.StringValue(z.Id)][c.ResourceRecordSet.Type] = make(map[string]bool)
if visitedHostnames[aws.StringValue(z.Id)][*c.ResourceRecordSet.Type] == nil {
visitedHostnames[aws.StringValue(z.Id)][*c.ResourceRecordSet.Type] = make(map[string]bool)
}

if visitedHostnames[aws.StringValue(z.Id)][c.ResourceRecordSet.Type][hostname] {
log.Debugf("Skipping duplicate %s to zone %s [Id: %s] RecordType: %s", hostname, aws.StringValue(z.Name), aws.StringValue(z.Id), c.ResourceRecordSet.Type)
if visitedHostnames[aws.StringValue(z.Id)][*c.ResourceRecordSet.Type][hostname] {
log.Debugf("Skipping duplicate %s to zone %s [Id: %s] RecordType: %s", hostname, aws.StringValue(z.Name), aws.StringValue(z.Id), *c.ResourceRecordSet.Type)
continue
}

Expand All @@ -1019,8 +1019,8 @@ func changesByZone(zones map[string]*route53.HostedZone, changeSet Route53Change
}
}
changes[aws.StringValue(z.Id)] = append(changes[aws.StringValue(z.Id)], c)
visitedHostnames[aws.StringValue(z.Id)][c.ResourceRecordSet.Type][hostname] = true
log.Debugf("Adding %s to zone %s [Id: %s] RecordType: %s", hostname, aws.StringValue(z.Name), aws.StringValue(z.Id), c.ResourceRecordSet.Type)
visitedHostnames[aws.StringValue(z.Id)][*c.ResourceRecordSet.Type][hostname] = true
log.Debugf("Adding %s to zone %s [Id: %s] RecordType: %s", hostname, aws.StringValue(z.Name), aws.StringValue(z.Id), *c.ResourceRecordSet.Type)
}
}

Expand Down

0 comments on commit 7c7a1c3

Please sign in to comment.