@@ -466,51 +466,39 @@ func (m *podManager) getContainerNetnsPath(id string) (string, error) {
466
466
}
467
467
468
468
// Update OVS flows when something (like the pod's namespace VNID) changes
469
- func (m * podManager ) update (req * cniserver.PodRequest ) (* runningPod , error ) {
469
+ func (m * podManager ) update (req * cniserver.PodRequest ) (uint32 , error ) {
470
470
// Updates may come at startup and thus we may not have the pod's
471
471
// netns from kubelet (since kubelet doesn't have UPDATE actions).
472
472
// Read the missing netns from the pod's file.
473
473
if req .Netns == "" {
474
474
netns , err := m .getContainerNetnsPath (req .ContainerId )
475
475
if err != nil {
476
- return nil , err
476
+ return 0 , err
477
477
}
478
478
req .Netns = netns
479
479
}
480
480
481
- podConfig , pod , err := m .getPodConfig (req )
481
+ podConfig , _ , err := m .getPodConfig (req )
482
482
if err != nil {
483
- return nil , err
483
+ return 0 , err
484
484
}
485
485
486
486
hostVethName , contVethMac , podIP , err := getVethInfo (req .Netns , podInterfaceName )
487
487
if err != nil {
488
- return nil , err
488
+ return 0 , err
489
489
}
490
490
491
491
vnidStr := vnidToString (podConfig .vnid )
492
492
out , err := exec .Command (sdnScript , updateCmd , hostVethName , contVethMac , podIP , vnidStr , podConfig .ingressBandwidth , podConfig .egressBandwidth ).CombinedOutput ()
493
493
glog .V (5 ).Infof ("UpdatePod network plugin output: %s, %v" , string (out ), err )
494
494
495
495
if isScriptError (err ) {
496
- return nil , fmt .Errorf ("error running network update script: %s" , getScriptError (out ))
496
+ return 0 , fmt .Errorf ("error running network update script: %s" , getScriptError (out ))
497
497
} else if err != nil {
498
- return nil , err
498
+ return 0 , err
499
499
}
500
500
501
- ofport , err := m .ovs .GetOFPort (hostVethName )
502
- if err != nil {
503
- return nil , err
504
- }
505
-
506
- return & runningPod {
507
- activePod : & kubehostport.ActivePod {
508
- Pod : pod ,
509
- IP : net .ParseIP (podIP ),
510
- },
511
- vnid : podConfig .vnid ,
512
- ofport : ofport ,
513
- }, nil
501
+ return podConfig .vnid , nil
514
502
}
515
503
516
504
// Clean up all pod networking (clear OVS flows, release IPAM lease, remove host/container veth)
0 commit comments