diff --git a/controller/controller.go b/controller/controller.go index 0cdd82cd6a..f651f103e4 100644 --- a/controller/controller.go +++ b/controller/controller.go @@ -210,7 +210,10 @@ func (c *Controller) RunOnce(ctx context.Context) error { return err } - records = endpoint.RemoveDuplicates(records) + //records = endpoint.RemoveDuplicates(records) + //This deduplication could be a different but valid solution + //With this in place the change on plan.go is not needed + //Keeping this here until we decide what's best registryEndpointsTotal.Set(float64(len(records))) regARecords, regAAAARecords := countAddressRecords(records) registryARecords.Set(float64(regARecords)) diff --git a/endpoint/endpoint.go b/endpoint/endpoint.go index da262d6d6b..08c9c6b238 100644 --- a/endpoint/endpoint.go +++ b/endpoint/endpoint.go @@ -354,8 +354,7 @@ func RemoveDuplicates(endpoints []*Endpoint) []*Endpoint { if _, found := visited[key]; !found { result = append(result, ep) - //visited[key] = struct{}{} - // Currently Debugging 0.14.0 to see the exact root cause + visited[key] = struct{}{} } else { log.Debugf(`Skipping duplicated endpoint: %v`, ep) } diff --git a/plan/plan.go b/plan/plan.go index b4100328d1..0dc4854ac6 100644 --- a/plan/plan.go +++ b/plan/plan.go @@ -252,6 +252,10 @@ func (p *Plan) Calculate() *Plan { // filter out updates this external dns does not have ownership claim over if p.OwnerID != "" { changes.Delete = endpoint.FilterEndpointsByOwnerID(p.OwnerID, changes.Delete) + // Remove duplicated endpoints generated by plan.go on Line 196 + changes.Delete = endpoint.RemoveDuplicates(changes.Delete) + // This was not needed on version 0.13.6, but it seems like + // the old function/code had the ability of removing duplicated endpoints changes.UpdateOld = endpoint.FilterEndpointsByOwnerID(p.OwnerID, changes.UpdateOld) changes.UpdateNew = endpoint.FilterEndpointsByOwnerID(p.OwnerID, changes.UpdateNew) }