From 7c7a1c30ef8c2191092e18a23ebddb10cab8e8f0 Mon Sep 17 00:00:00 2001 From: Leonardo Quatrocchi Date: Sun, 3 Mar 2024 16:36:32 -0300 Subject: [PATCH] Group By Endpoint names per Hosted Zone on AWS --- provider/aws/aws.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/provider/aws/aws.go b/provider/aws/aws.go index 06b8a71ab..f581fcdf1 100644 --- a/provider/aws/aws.go +++ b/provider/aws/aws.go @@ -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 } @@ -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) } }