fix wrong use of advertiseVIPs where withdrawVIPs is required (#436)

This commit is contained in:
Murali Reddy 2018-05-13 09:14:09 +05:30 committed by GitHub
parent b0733cb581
commit 6d86656f5e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 {