-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lrp: Skip clusterIP service restore in service delete callback #16548
lrp: Skip clusterIP service restore in service delete callback #16548
Conversation
Previously, we were restoring the original clusterIP service even when the service was deleted. Signed-off-by: Aditi Ghag <aditi@cilium.io>
The `deletePolicyService` function was previously common to both delete policy and delete service callbacks. Refactor the logic to pass the policy config directly, thereby skip config look up. Signed-off-by: Aditi Ghag <aditi@cilium.io>
test-only --focus="K8sServicesTest.* LRP" --kernel_version="net-next" |
Focused LRP tests, including the restore test, have passed. |
I think this change makes the logic much more clearer, but I'm curious is the old behavior causing a bug though? I mean we restore from the svc cache, so if the svc is deleted, there should not be any entry for us to restore to even if we try? |
I found this unnecessary logic being executed while reading through the code. This could potentially lead to problems if there is a race between service cache deletion and LRP manager service look up. I think the current service event callbacks handlers are synchronous, but that's likely to change in future. Regardless, it's logically incorrect? |
Review is in. Marking as ready for merge. |
Yea, totally, I'm with you there, was just curious what problem this could cause :) |
@aditighag I switched this PR from |
See commit message.