mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +00:00
Merge pull request #97716 from chengzhycn/syncEndpoint-error-return
proxy/ipvs: return non-nil error when there is no matched IPVS servic…
This commit is contained in:
commit
5150d2f839
@ -18,6 +18,7 @@ package ipvs
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"io/ioutil"
|
"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 {
|
func (proxier *Proxier) syncEndpoint(svcPortName proxy.ServicePortName, onlyNodeLocalEndpoints bool, vs *utilipvs.VirtualServer) error {
|
||||||
appliedVirtualServer, err := proxier.ipvs.GetVirtualServer(vs)
|
appliedVirtualServer, err := proxier.ipvs.GetVirtualServer(vs)
|
||||||
if err != nil || appliedVirtualServer == nil {
|
if err != nil {
|
||||||
klog.Errorf("Failed to get IPVS service, error: %v", err)
|
klog.Errorf("Failed to get IPVS service, error: %v", err)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
if appliedVirtualServer == nil {
|
||||||
|
return errors.New("IPVS virtual service does not exist")
|
||||||
|
}
|
||||||
|
|
||||||
// curEndpoints represents IPVS destinations listed from current system.
|
// curEndpoints represents IPVS destinations listed from current system.
|
||||||
curEndpoints := sets.NewString()
|
curEndpoints := sets.NewString()
|
||||||
|
Loading…
Reference in New Issue
Block a user