mirror of
https://github.com/cloudnativelabs/kube-router.git
synced 2025-10-05 15:01:04 +02:00
fix wrong use of advertiseVIPs where withdrawVIPs is required (#436)
This commit is contained in:
parent
b0733cb581
commit
6d86656f5e
@ -93,6 +93,7 @@ func (nrc *NetworkRoutingController) OnServiceUpdate(obj interface{}) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// update export policies so that new VIP's gets addedd to clusteripprefixsit and vip gets advertised to peers
|
||||||
err = nrc.addExportPolicies()
|
err = nrc.addExportPolicies()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
glog.Errorf("Error adding BGP export policies: %s", err.Error())
|
glog.Errorf("Error adding BGP export policies: %s", err.Error())
|
||||||
@ -126,8 +127,14 @@ func (nrc *NetworkRoutingController) OnServiceDelete(obj interface{}) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// update export policies so that deleted VIP's gets removed from clusteripprefixsit
|
||||||
|
err = nrc.addExportPolicies()
|
||||||
|
if err != nil {
|
||||||
|
glog.Errorf("Error adding BGP export policies: %s", err.Error())
|
||||||
|
}
|
||||||
|
|
||||||
if len(toAdvertise) > 0 {
|
if len(toAdvertise) > 0 {
|
||||||
nrc.withdrawVIPs(toWithdraw)
|
nrc.withdrawVIPs(toAdvertise)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(toWithdraw) > 0 {
|
if len(toWithdraw) > 0 {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user