diff --git a/pkg/proxy/ipvs/proxier.go b/pkg/proxy/ipvs/proxier.go index 9dc69e78d0f..d5f281ed5b0 100644 --- a/pkg/proxy/ipvs/proxier.go +++ b/pkg/proxy/ipvs/proxier.go @@ -18,6 +18,7 @@ package ipvs import ( "bytes" + "errors" "fmt" "io" "io/ioutil" @@ -2007,10 +2008,13 @@ func (proxier *Proxier) syncService(svcName string, vs *utilipvs.VirtualServer, func (proxier *Proxier) syncEndpoint(svcPortName proxy.ServicePortName, onlyNodeLocalEndpoints bool, vs *utilipvs.VirtualServer) error { appliedVirtualServer, err := proxier.ipvs.GetVirtualServer(vs) - if err != nil || appliedVirtualServer == nil { + if err != nil { klog.Errorf("Failed to get IPVS service, error: %v", err) return err } + if appliedVirtualServer == nil { + return errors.New("IPVS virtual service does not exist") + } // curEndpoints represents IPVS destinations listed from current system. curEndpoints := sets.NewString()