Skip to content

Commit b76d22f

Browse files
jjomurali-reddy
authored andcommitted
[jjo] ipAddrDel(): also delete VIP local rt addition (#514)
1 parent 624c74f commit b76d22f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

pkg/controllers/proxy/network_services_controller.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,14 @@ func (ln *linuxNetworking) ipAddrDel(iface netlink.Link, ip string) error {
101101
glog.Errorf("Failed to verify is external ip %s is assocated with dummy interface %s due to %s",
102102
naddr.IPNet.IP.String(), KUBE_DUMMY_IF, err.Error())
103103
}
104+
// Delete VIP addition to "local" rt table also, fail silently if not found (DSR special case)
105+
if err == nil {
106+
out, err := exec.Command("ip", "route", "delete", "local", ip, "dev", KUBE_DUMMY_IF, "table", "local", "proto", "kernel", "scope", "host", "src",
107+
NodeIP.String(), "table", "local").CombinedOutput()
108+
if err != nil && !strings.Contains(string(out), "No such process") {
109+
glog.Errorf("Failed to delete route to service VIP %s configured on %s. Error: %v, Output: %s", ip, KUBE_DUMMY_IF, err, out)
110+
}
111+
}
104112
return err
105113
}
106114

0 commit comments

Comments
 (0)