File tree 1 file changed +8
-0
lines changed
1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -130,6 +130,7 @@ func (c *Controller) handleAddNode(key string) error {
130
130
}
131
131
132
132
var v4IP , v6IP , mac string
133
+
133
134
portName := util .NodeLspName (key )
134
135
if node .Annotations [util .AllocatedAnnotation ] == "true" && node .Annotations [util .IPAddressAnnotation ] != "" && node .Annotations [util .MacAddressAnnotation ] != "" {
135
136
macStr := node .Annotations [util .MacAddressAnnotation ]
@@ -145,6 +146,13 @@ func (c *Controller) handleAddNode(key string) error {
145
146
klog .Errorf ("failed to alloc random ip addrs for node %v: %v" , node .Name , err )
146
147
return err
147
148
}
149
+
150
+ // Clean up potentially existing logical switch ports to avoid leftover issues from previous failed configurations
151
+ if err := c .OVNNbClient .DeleteLogicalSwitchPort (portName ); err != nil {
152
+ klog .Errorf ("failed to delete stale logical switch port %s: %v" , portName , err )
153
+ return err
154
+ }
155
+ klog .Infof ("deleted stale logical switch port %s" , portName )
148
156
}
149
157
150
158
ipStr := util .GetStringIP (v4IP , v6IP )
You can’t perform that action at this time.
0 commit comments