File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -395,7 +395,19 @@ func (c *Controller) markAndCleanLSP() error {
395395 vipsMap := strset .NewWithSize (len (vips ))
396396 for _ , vip := range vips {
397397 if vip .Spec .Type != "" {
398- portName := ovs .PodNameToPortName (vip .Name , vip .Spec .Namespace , util .OvnProvider )
398+ subnetName := vip .Spec .Subnet
399+ if subnetName == "" {
400+ klog .Errorf ("failed to gc vip '%s', subnet should be set" , vip .Name )
401+ continue
402+ }
403+
404+ subnet , err := c .subnetsLister .Get (subnetName )
405+ if err != nil {
406+ klog .Errorf ("failed to get subnet %s: %v" , subnetName , err )
407+ continue
408+ }
409+
410+ portName := ovs .PodNameToPortName (vip .Name , vip .Spec .Namespace , subnet .Spec .Provider )
399411 vipsMap .Add (portName )
400412 }
401413 }
You can’t perform that action at this time.
0 commit comments