Skip to content

Commit

Permalink
when in table mode we always want to clean routes
Browse files Browse the repository at this point in the history
Signed-off-by: Marcel Fest <marcel.fest@telekom.de>
  • Loading branch information
Cellebyte committed May 17, 2024
1 parent 1620e4c commit 25c2532
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/cluster/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,11 @@ func (cluster *Cluster) StartLoadBalancerService(c *kubevip.Config, bgp *bgp.Ser
// Stop the Arp context if it is running
cancelArp()

if c.EnableRoutingTable && (c.EnableLeaderElection || c.EnableServicesElection) {
log.Info("[LOADBALANCER] Stopping load balancers")

if c.EnableRoutingTable {
for i := range cluster.Network {
log.Infof("[VIP] Deleting Route for Virtual IP [%s]", cluster.Network[i].IP())
if err := cluster.Network[i].DeleteRoute(); err != nil {
log.Warnf("%v", err)
}
Expand All @@ -230,9 +233,6 @@ func (cluster *Cluster) StartLoadBalancerService(c *kubevip.Config, bgp *bgp.Ser
close(cluster.completed)
return
}

log.Info("[LOADBALANCER] Stopping load balancers")

for i := range cluster.Network {
log.Infof("[VIP] Releasing the Virtual IP [%s]", cluster.Network[i].IP())
if err := cluster.Network[i].DeleteIP(); err != nil {
Expand Down

0 comments on commit 25c2532

Please sign in to comment.