egressgateway: Use UID to identify CiliumEndpoints in epDataStore #29124
+97
−17
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
To address a potential race condition demonstrated by a unit test added as part of this change, this changes internal type of the
endpointID
used to identifyCiliumEndpoint
s in the EGW Manager'sepDataStore
fromNamespacedName
toUID
.The race fixed by this change may be triggered during statefulset pod restart/migration to a different node, when a new endpoint may co-exist with the to-be-deleted endpoint with the same
NamespacedName
for a short period of time. To not break EGW Manager's endpoint event handling, these two need to have uniqueendpointID
, which can be satisfied by relying on theUID
.The drawback of using
UID
is incompatibility withCiliumEndpointSlices
, which is however not an issue for the EGW, as it is already incompatible. In the future the EGW will probably move away from relying onCiliumEndpoint
s altogether, which should remove this limitation.