mirror of
https://hubproxy.babadafafafafa.cn/https://github.com/kube-vip/kube-vip.git
synced 2026-09-20 08:03:47 +08:00
Fixed route cleanup on startup in RT mode (#1679)
Signed-off-by: Patryk Strusiewicz-Surmacki <patryk.pawel.strusiewicz-surmacki@external.telekom.de> Co-authored-by: Patryk Strusiewicz-Surmacki <patryk.pawel.strusiewicz-surmacki@external.telekom.de>
This commit is contained in:
committed by
GitHub
parent
4577f5bbe2
commit
530c602152
@@ -100,7 +100,7 @@ func (t *Table) cleanRoutes() error {
|
||||
if t.config.EnableControlPlane {
|
||||
found = (routes[i].Dst.IP.String() == t.config.Address)
|
||||
} else {
|
||||
found = t.routeMgr.Check(routes[i].String())
|
||||
found = t.routeMgr.Check(vip.NetlinkHash(&(routes[i])))
|
||||
}
|
||||
|
||||
if !found {
|
||||
|
||||
@@ -328,6 +328,10 @@ func (configurator *network) PrepareRoute() *netlink.Route {
|
||||
|
||||
func (configurator *network) RouteHash() string {
|
||||
r := configurator.PrepareRoute()
|
||||
return NetlinkHash(r)
|
||||
}
|
||||
|
||||
func NetlinkHash(r *netlink.Route) string {
|
||||
h := fnv.New32a()
|
||||
h.Write([]byte(r.String()))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user