@@ -56,9 +56,7 @@ func (np *NetworkDriver) Synchronize(_ context.Context, pods []*api.PodSandbox,
5656 ns , isLive := livePodNetNs [storedUID ]
5757
5858 if isLive {
59- if ns != "" {
60- np .podConfigStore .SetPodNetNs (storedUID , ns )
61- }
59+ np .podConfigStore .SetPodNetNs (storedUID , ns )
6260 } else {
6361 klog .Infof ("Synchronize: pruning stale config for pod %s" , storedUID )
6462 np .podConfigStore .DeletePod (storedUID )
@@ -370,18 +368,16 @@ func (np *NetworkDriver) stopPodSandbox(_ context.Context, pod *api.PodSandbox,
370368 // we workaround it using the local copy we have in the db to associate interfaces with Pods via
371369 // the network namespace id.
372370 storedNs , ok := np .podConfigStore .GetPodNetNs (types .UID (pod .GetUid ()))
373- if ok {
374- if storedNs != "" {
375- ns = storedNs
376- } else {
377- // Pod is not configured for DRAnet (host network or other driver)
378- klog .Infof ("StopPodSandbox pod %s/%s using host network ... skipping" , pod .Namespace , pod .Name )
379- return nil
380- }
381- } else {
371+ if ! ok {
382372 klog .Warningf ("StopPodSandbox: pod %s/%s (UID %s) not found in podConfigStore when fetching fallback NetNS" , pod .Namespace , pod .Name , pod .Uid )
383373 return nil
384374 }
375+ if storedNs == "" {
376+ // Pod is not configured for DRAnet (host network or other driver)
377+ klog .Infof ("StopPodSandbox pod %s/%s using host network ... skipping" , pod .Namespace , pod .Name )
378+ return nil
379+ }
380+ ns = storedNs
385381 }
386382 needsRescan := false
387383 for deviceName , config := range podConfig .DeviceConfigs {
0 commit comments