File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change 4
4
"context"
5
5
"errors"
6
6
"fmt"
7
+ "maps"
7
8
"strings"
8
9
"time"
9
10
@@ -238,11 +239,16 @@ func (c *Controller) initClusterRouter() error {
238
239
return err
239
240
}
240
241
241
- lr .Options = map [string ]string {"always_learn_from_arp_request" : "false" , "dynamic_neigh_routers" : "true" , "mac_binding_age_threshold" : "300" }
242
- err = c .OVNNbClient .UpdateLogicalRouter (lr , & lr .Options )
243
- if err != nil {
244
- klog .Errorf ("update logical router %s failed: %v" , c .config .ClusterRouter , err )
245
- return err
242
+ lrOptions := make (map [string ]string , len (lr .Options ))
243
+ maps .Copy (lrOptions , lr .Options )
244
+ lrOptions ["mac_binding_age_threshold" ] = "300"
245
+ lrOptions ["dynamic_neigh_routers" ] = "true"
246
+ if ! maps .Equal (lr .Options , lrOptions ) {
247
+ lr .Options = lrOptions
248
+ if err = c .OVNNbClient .UpdateLogicalRouter (lr , & lr .Options ); err != nil {
249
+ klog .Errorf ("update logical router %s failed: %v" , c .config .ClusterRouter , err )
250
+ return err
251
+ }
246
252
}
247
253
248
254
return nil
You can’t perform that action at this time.
0 commit comments