-
Notifications
You must be signed in to change notification settings - Fork 363
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
Delete Pod specific VF resource cache from Podwatch controller, when a Pod gets deleted. #4285
Delete Pod specific VF resource cache from Podwatch controller, when a Pod gets deleted. #4285
Conversation
Codecov Report
@@ Coverage Diff @@
## main #4285 +/- ##
==========================================
+ Coverage 63.16% 64.29% +1.13%
==========================================
Files 388 393 +5
Lines 55147 55548 +401
==========================================
+ Hits 34833 35714 +881
+ Misses 17766 17224 -542
- Partials 2548 2610 +62
|
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.
given that this fixes a bug, the PR should also add a unit test to cover this scenario
podKey := podNamespace + "/" + podName | ||
_, cacheFound := pc.vfDeviceIDUsageMap.Load(podKey) | ||
if cacheFound { | ||
klog.InfoS("Pod specific VF Cache cleared for ", "pod", podKey) |
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.
this should be
klog.InfoS("Pod specific VF cache cleared", "key", podKey)
But if you want to have this log message, I think the verbosity needs to be changed (e.g., to V(2)
). It is also surprising that we have a log message for the deletion case but not when the cache entry is created or modified.
@@ -290,6 +300,8 @@ func (pc *PodController) handleRemovePod(key string) error { | |||
} else { | |||
// Delete cache entry from podCNIInfo. | |||
pc.podCache.DeleteCNIConfigInfo(containerInfo) | |||
// Delete Pod specific VF cache (if one exist) |
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.
s/exist/exists
44cc920
to
64b2744
Compare
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.
@arunvelayutham : I saw irrelevant files in your comments (a.log, a.txt, etc.). Could you please fix?
64b2744
to
8afc1fe
Compare
@jianjuns looks like a test commit got accidently push (while I was addressing the git issue last week). fix it now. |
…atch controller Signed-off-by: Arunkumar Velayutham <arunkumar.velayutham@intel.com>
5ae73fa
to
fd2d8c8
Compare
@@ -290,6 +301,8 @@ func (pc *PodController) handleRemovePod(key string) error { | |||
} else { | |||
// Delete cache entry from podCNIInfo. | |||
pc.podCache.DeleteCNIConfigInfo(containerInfo) | |||
// Delete Pod specific VF cache (if one exists) | |||
pc.deleteVFDeviceIDListPerPod(containerInfo.PodName, containerInfo.PodNameSpace) |
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.
Question - could we pass key
argument of handleRemovePod() to deleteVFDeviceIDListPerPod()
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.
Yes, key from the function argument can be used as well.
/test-e2e |
/test-networkpolicy |
/test-conformance |
Upon a CNF Pod delete, clear Pod VF cache in the secondary network's podwatch controller. Signed-off-by: Arunkumar Velayutham <arunkumar.velayutham@intel.com>
Upon a CNF Pod delete, clear Pod VF cache in the secondary network's podwatch controller. Signed-off-by: Arunkumar Velayutham <arunkumar.velayutham@intel.com>
When a Pod gets deleted and recreated, secondary network configuration fails due to misconfigured VF resource cache. Pod specific VF resource must be cleared, when a Pod gets deleted everything.
NOTE: Upon Pod creation, Podwatch controller will build a VF resource cache, if the Pod annotates to configure SRIOV based secondary network interfaces.
Signed-off-by: Arunkumar Velayutham arunkumar.velayutham@intel.com