Skip to content

Commit

Permalink
Update endpoint.go with Key function
Browse files Browse the repository at this point in the history
  • Loading branch information
leonardocaylent authored Mar 16, 2024
1 parent cea0496 commit a3826d5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion endpoint/endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,8 @@ func FilterEndpointsByOwnerID(ownerID string, eps []*Endpoint) []*Endpoint {
filtered := []*Endpoint{}
visited := make(map[EndpointKey]bool) // Initialize the visited map
for _, ep := range eps {
key := EndpointKey{DNSName: ep.DNSName, RecordType: ep.RecordType, SetIdentifier: ep.SetIdentifier}
//key := EndpointKey{DNSName: ep.DNSName, RecordType: ep.RecordType, SetIdentifier: ep.SetIdentifier} --< this line passes the unit tests but I think it's wrong
key := ep.Key() // This function should be the primary key for endpoints but it's only considering DNSName, RecordType & SetIdentifier.
if visited[key] { //Do not contain duplicated endpoints
log.Debugf(`Already loaded endpoint %v `, ep)
continue
Expand Down

0 comments on commit a3826d5

Please sign in to comment.