fix null pointer dereference during kube-router --cleanup-config

Fixes #79
This commit is contained in:
Murali Reddy 2017-07-27 23:24:03 +05:30
parent c64b72e4a3
commit a86bc44ecc

View File

@ -767,7 +767,14 @@ func getKubeDummyInterface() (netlink.Link, error) {
func (nsc *NetworkServicesController) Cleanup() {
// cleanup ipvs rules by flush
glog.Infof("Cleaning up IPVS configuration permanently")
err := h.Flush()
handle, err := libipvs.New()
if err != nil {
glog.Errorf("Failed to cleanup ipvs rules: ", err.Error())
return
}
err = handle.Flush()
if err != nil {
glog.Errorf("Failed to cleanup ipvs rules: ", err.Error())
return