@@ -217,12 +217,7 @@ func (oc *ovsController) SetupOVS(clusterNetworkCIDR []string, serviceNetworkCID
217
217
// Table 253: rule version note
218
218
otx .AddFlow ("table=%d, actions=note:%s" , ruleVersionTable , oc .getVersionNote ())
219
219
220
- err = otx .EndTransaction ()
221
- if err != nil {
222
- return err
223
- }
224
-
225
- return nil
220
+ return otx .Commit ()
226
221
}
227
222
228
223
func (oc * ovsController ) NewTransaction () ovs.Transaction {
@@ -255,7 +250,7 @@ func (oc *ovsController) setupPodFlows(ofport int, podIP net.IP, vnid uint32) er
255
250
// IP traffic to container
256
251
otx .AddFlow ("table=70, priority=100, ip, nw_dst=%s, actions=load:%d->NXM_NX_REG1[], load:%d->NXM_NX_REG2[], goto_table:80" , ipstr , vnid , ofport )
257
252
258
- return otx .EndTransaction ()
253
+ return otx .Commit ()
259
254
}
260
255
261
256
func (oc * ovsController ) cleanupPodFlows (podIP net.IP ) error {
@@ -266,7 +261,7 @@ func (oc *ovsController) cleanupPodFlows(podIP net.IP) error {
266
261
otx .DeleteFlows ("ip, nw_src=%s" , ipstr )
267
262
otx .DeleteFlows ("arp, nw_dst=%s" , ipstr )
268
263
otx .DeleteFlows ("arp, nw_src=%s" , ipstr )
269
- return otx .EndTransaction ()
264
+ return otx .Commit ()
270
265
}
271
266
272
267
func (oc * ovsController ) SetUpPod (sandboxID , hostVeth string , podIP net.IP , vnid uint32 ) (int , error ) {
@@ -501,7 +496,7 @@ func (oc *ovsController) UpdateEgressNetworkPolicyRules(policies []networkapi.Eg
501
496
otx .DeleteFlows ("table=101, reg0=%d, cookie=1/1" , vnid )
502
497
}
503
498
504
- if txErr := otx .EndTransaction (); txErr != nil {
499
+ if txErr := otx .Commit (); txErr != nil {
505
500
errs = append (errs , txErr )
506
501
}
507
502
@@ -526,7 +521,7 @@ func (oc *ovsController) AddHostSubnetRules(subnet *networkapi.HostSubnet) error
526
521
otx .AddFlow ("table=90, priority=100, cookie=0x%08x, ip, nw_dst=%s, actions=move:NXM_NX_REG0[]->NXM_NX_TUN_ID[0..31],set_field:%s->tun_dst,output:1" , cookie , subnet .Subnet , subnet .HostIP )
527
522
}
528
523
529
- return otx .EndTransaction ()
524
+ return otx .Commit ()
530
525
}
531
526
532
527
func (oc * ovsController ) DeleteHostSubnetRules (subnet * networkapi.HostSubnet ) error {
@@ -536,7 +531,7 @@ func (oc *ovsController) DeleteHostSubnetRules(subnet *networkapi.HostSubnet) er
536
531
otx .DeleteFlows ("table=10, cookie=0x%08x/0xffffffff, tun_src=%s" , cookie , subnet .HostIP )
537
532
otx .DeleteFlows ("table=50, cookie=0x%08x/0xffffffff, arp, nw_dst=%s" , cookie , subnet .Subnet )
538
533
otx .DeleteFlows ("table=90, cookie=0x%08x/0xffffffff, ip, nw_dst=%s" , cookie , subnet .Subnet )
539
- return otx .EndTransaction ()
534
+ return otx .Commit ()
540
535
}
541
536
542
537
func (oc * ovsController ) AddServiceRules (service * kapi.Service , netID uint32 ) error {
@@ -555,13 +550,13 @@ func (oc *ovsController) AddServiceRules(service *kapi.Service, netID uint32) er
555
550
otx .AddFlow (baseRule + action )
556
551
}
557
552
558
- return otx .EndTransaction ()
553
+ return otx .Commit ()
559
554
}
560
555
561
556
func (oc * ovsController ) DeleteServiceRules (service * kapi.Service ) error {
562
557
otx := oc .ovs .NewTransaction ()
563
558
otx .DeleteFlows (generateBaseServiceRule (service .Spec .ClusterIP ))
564
- return otx .EndTransaction ()
559
+ return otx .Commit ()
565
560
}
566
561
567
562
func generateBaseServiceRule (IP string ) string {
@@ -601,7 +596,7 @@ func (oc *ovsController) UpdateLocalMulticastFlows(vnid uint32, enabled bool, of
601
596
otx .DeleteFlows ("table=120, reg0=%d" , vnid )
602
597
}
603
598
604
- return otx .EndTransaction ()
599
+ return otx .Commit ()
605
600
}
606
601
607
602
func (oc * ovsController ) UpdateVXLANMulticastFlows (remoteIPs []string ) error {
@@ -618,7 +613,7 @@ func (oc *ovsController) UpdateVXLANMulticastFlows(remoteIPs []string) error {
618
613
otx .AddFlow ("table=111, priority=100, actions=goto_table:120" )
619
614
}
620
615
621
- return otx .EndTransaction ()
616
+ return otx .Commit ()
622
617
}
623
618
624
619
// FindUnusedVNIDs returns a list of VNIDs for which there are table 80 "check" rules,
@@ -702,14 +697,14 @@ func (oc *ovsController) ensureTunMAC() error {
702
697
func (oc * ovsController ) SetNamespaceEgressNormal (vnid uint32 ) error {
703
698
otx := oc .ovs .NewTransaction ()
704
699
otx .DeleteFlows ("table=100, reg0=%d" , vnid )
705
- return otx .EndTransaction ()
700
+ return otx .Commit ()
706
701
}
707
702
708
703
func (oc * ovsController ) SetNamespaceEgressDropped (vnid uint32 ) error {
709
704
otx := oc .ovs .NewTransaction ()
710
705
otx .DeleteFlows ("table=100, reg0=%d" , vnid )
711
706
otx .AddFlow ("table=100, priority=100, reg0=%d, actions=drop" , vnid )
712
- return otx .EndTransaction ()
707
+ return otx .Commit ()
713
708
}
714
709
715
710
func (oc * ovsController ) SetNamespaceEgressViaEgressIP (vnid uint32 , nodeIP , mark string ) error {
@@ -726,5 +721,5 @@ func (oc *ovsController) SetNamespaceEgressViaEgressIP(vnid uint32, nodeIP, mark
726
721
} else {
727
722
otx .AddFlow ("table=100, priority=100, reg0=%d, ip, actions=move:NXM_NX_REG0[]->NXM_NX_TUN_ID[0..31],set_field:%s->tun_dst,output:1" , vnid , nodeIP )
728
723
}
729
- return otx .EndTransaction ()
724
+ return otx .Commit ()
730
725
}
0 commit comments