Skip to content

Commit 6d86656

Browse files
authored
fix wrong use of advertiseVIPs where withdrawVIPs is required (#436)
1 parent b0733cb commit 6d86656

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

pkg/controllers/routing/ecmp_vip.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ func (nrc *NetworkRoutingController) OnServiceUpdate(obj interface{}) {
9393
return
9494
}
9595

96+
// update export policies so that new VIP's gets addedd to clusteripprefixsit and vip gets advertised to peers
9697
err = nrc.addExportPolicies()
9798
if err != nil {
9899
glog.Errorf("Error adding BGP export policies: %s", err.Error())
@@ -126,8 +127,14 @@ func (nrc *NetworkRoutingController) OnServiceDelete(obj interface{}) {
126127
return
127128
}
128129

130+
// update export policies so that deleted VIP's gets removed from clusteripprefixsit
131+
err = nrc.addExportPolicies()
132+
if err != nil {
133+
glog.Errorf("Error adding BGP export policies: %s", err.Error())
134+
}
135+
129136
if len(toAdvertise) > 0 {
130-
nrc.withdrawVIPs(toWithdraw)
137+
nrc.withdrawVIPs(toAdvertise)
131138
}
132139

133140
if len(toWithdraw) > 0 {

0 commit comments

Comments
 (0)