You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
During getting Source Endpoints: endpoints, err := c.Source.Endpoints(ctx) also performed de-duplication based on following attributes: DNSName, Targets and SetIdentifier.
Here is de-duplication simplified code:
for _, ep := range endpoints {
identifier := ep.DNSName + " / " + ep.SetIdentifier + " / " + ep.Targets.String()
if _, ok := collected[identifier]; ok {
log.Debugf("Removing duplicate endpoint %s", ep)
continue
}
collected[identifier] = true
result = append(result, ep)
}
Thus, some Source Endpoints from sources are deleted before they are updated by AdjustEndpoints.
This leads to unexpected deletion de-duplicated records from DNS because they are de-deplicated before call AdjustEndpoints.
For example, SetIdentifier can be set or updated via AdjustEndpoints call to provider, after this Source Endpoint can became unique but has been de-duplicated before.
Or vice-versa case, provider can change SetIdentifier and Endpoint after AdjustEndpoints will be (should be) de-duplicated.
Finally, changed SetIdentifier used in planKey which with looks like a broken logic when we might perform de-duplication using different SetIdentifier value.
What you expected to happen:
I expect that Source Endpoints de-duplication performed after AdjustEndpoints call.
How to reproduce it (as minimally and precisely as possible):
It is clear from code.
Environment:
External-DNS version: v0.14.1
DNS provider: custom
BTW, I know there is annotation for setting SetIdentifier property, but it not solve this logic with AdjustEndpoints.
The text was updated successfully, but these errors were encountered:
krasoffski
changed the title
Endpoint de-duplication (dedupSource) performed before AdjustEndpoints
Source Endpoints de-duplication (dedupSource) performed before AdjustEndpoints
May 22, 2024
What happened:
Controller
RunOnce
get Records and than Source Endpoints.After this, it performs
AdjustEndpoints
for Source Endpoints.Here is simplified part.
During getting Source Endpoints:
endpoints, err := c.Source.Endpoints(ctx)
also performed de-duplication based on following attributes:DNSName
,Targets
andSetIdentifier
.Here is de-duplication simplified code:
Thus, some Source Endpoints from sources are deleted before they are updated by
AdjustEndpoints
.This leads to unexpected deletion de-duplicated records from DNS because they are de-deplicated before call
AdjustEndpoints
.For example,
SetIdentifier
can be set or updated viaAdjustEndpoints
call to provider, after this Source Endpoint can became unique but has been de-duplicated before.Or vice-versa case, provider can change
SetIdentifier
and Endpoint afterAdjustEndpoints
will be (should be) de-duplicated.Finally, changed
SetIdentifier
used inplanKey
which with looks like a broken logic when we might perform de-duplication using differentSetIdentifier
value.What you expected to happen:
I expect that Source Endpoints de-duplication performed after
AdjustEndpoints
call.How to reproduce it (as minimally and precisely as possible):
It is clear from code.
Environment:
BTW, I know there is annotation for setting
SetIdentifier
property, but it not solve this logic withAdjustEndpoints
.The text was updated successfully, but these errors were encountered: