mirror of
https://github.com/cloudnativelabs/kube-router.git
synced 2025-10-07 07:51:26 +02:00
perform clean-up of external ip from custom route table for external ip only if the table is not empty (#437)
This commit is contained in:
parent
6d86656f5e
commit
0538a2a93e
@ -1686,11 +1686,12 @@ func (ln *linuxNetworking) setupRoutesForExternalIPForDSR(serviceInfoMap service
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// check if there are any pbr in externalIPRouteTableId for external IP's
|
||||||
|
if len(outStr) > 0 {
|
||||||
// clean up stale external IPs
|
// clean up stale external IPs
|
||||||
for _, line := range strings.Split(strings.Trim(outStr, "\n"), "\n") {
|
for _, line := range strings.Split(strings.Trim(outStr, "\n"), "\n") {
|
||||||
route := strings.Split(strings.Trim(line, " "), " ")
|
route := strings.Split(strings.Trim(line, " "), " ")
|
||||||
ip := route[0]
|
ip := route[0]
|
||||||
|
|
||||||
if !activeExternalIPs[ip] {
|
if !activeExternalIPs[ip] {
|
||||||
args := []string{"route", "del", "table", externalIPRouteTableId}
|
args := []string{"route", "del", "table", externalIPRouteTableId}
|
||||||
args = append(args, route...)
|
args = append(args, route...)
|
||||||
@ -1700,6 +1701,7 @@ func (ln *linuxNetworking) setupRoutesForExternalIPForDSR(serviceInfoMap service
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user