-
Notifications
You must be signed in to change notification settings - Fork 108
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
Fix k8 namespace cache in database #1059
Conversation
@@ -108,19 +108,35 @@ func (id *Database) OnDeletion(containerID []string) { | |||
} | |||
} | |||
|
|||
func (id *Database) addProcess(ifp *container.Info) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did this refactor so that I can use this logic in a test.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1059 +/- ##
==========================================
+ Coverage 81.76% 81.79% +0.03%
==========================================
Files 139 139
Lines 11289 11297 +8
==========================================
+ Hits 9230 9240 +10
+ Misses 1542 1541 -1
+ Partials 517 516 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💪
I think this fixes a bug that was very hard to track. Essentially, we saw a wrong service name used for events in a cluster, where there were a few subsequent launches and deaths of containers.
A container namespace was reused between two services on the new launch and the k8s decorator resolved the wrong name for the service, even though we had the correct destination name in the IP to name resolution. This means that the service IP caches were correct, but the name info was stale.
I made two changes to ensure we cleanup the namespace cache: