mirror of
https://github.com/cloudnativelabs/kube-router.git
synced 2026-05-05 14:46:14 +02:00
infer endpoint is local from endpoints "subset.addresses.nodeName" (#560)
Fixes #557
This commit is contained in:
parent
d9570c5872
commit
827bbbcd4d
@ -65,7 +65,7 @@ type ipvsCalls interface {
|
||||
ipvsDelService(ipvsSvc *ipvs.Service) error
|
||||
ipvsUpdateService(ipvsSvc *ipvs.Service) error
|
||||
ipvsGetServices() ([]*ipvs.Service, error)
|
||||
ipvsAddServer(ipvsSvc *ipvs.Service, ipvsDst *ipvs.Destination, local bool, podCidr string) error
|
||||
ipvsAddServer(ipvsSvc *ipvs.Service, ipvsDst *ipvs.Destination) error
|
||||
ipvsNewDestination(ipvsSvc *ipvs.Service, ipvsDst *ipvs.Destination) error
|
||||
ipvsUpdateDestination(ipvsSvc *ipvs.Service, ipvsDst *ipvs.Destination) error
|
||||
ipvsGetDestinations(ipvsSvc *ipvs.Service) ([]*ipvs.Destination, error)
|
||||
@ -241,8 +241,9 @@ type serviceInfoMap map[string]*serviceInfo
|
||||
|
||||
// internal representation of endpoints
|
||||
type endpointsInfo struct {
|
||||
ip string
|
||||
port int
|
||||
ip string
|
||||
port int
|
||||
isLocal bool
|
||||
}
|
||||
|
||||
// map of all endpoints, with unique service id(namespace name, service name, port) as key
|
||||
@ -469,29 +470,13 @@ type externalIPService struct {
|
||||
externalIp string
|
||||
}
|
||||
|
||||
func hasActiveEndpoints(svc *serviceInfo, endpoints []endpointsInfo, nodePodCidrStr string) bool {
|
||||
if svc.local {
|
||||
_, nodePodCidr, err := net.ParseCIDR(nodePodCidrStr)
|
||||
if err != nil {
|
||||
glog.Errorf("Failed to ParseCIDR %s for hasActiveEndpoints on service %s/%s",
|
||||
nodePodCidrStr, svc.namespace, svc.name)
|
||||
return false
|
||||
func hasActiveEndpoints(svc *serviceInfo, endpoints []endpointsInfo) bool {
|
||||
for _, endpoint := range endpoints {
|
||||
if endpoint.isLocal {
|
||||
return true
|
||||
}
|
||||
for _, endpoint := range endpoints {
|
||||
ip := net.ParseIP(endpoint.ip)
|
||||
if ip == nil {
|
||||
glog.Errorf("Failed to ParseCIDR %s for endpoint in hasActiveEndpoints on service %s/%s",
|
||||
endpoint.ip, svc.namespace, svc.name)
|
||||
continue
|
||||
}
|
||||
if nodePodCidr.Contains(ip) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
return len(endpoints) > 0
|
||||
return false
|
||||
}
|
||||
|
||||
// sync the ipvs service and server details configured to reflect the desired state of services and endpoint
|
||||
@ -555,7 +540,7 @@ func (nsc *NetworkServicesController) syncIpvsServices(serviceInfoMap serviceInf
|
||||
|
||||
endpoints := endpointsInfoMap[k]
|
||||
|
||||
if !hasActiveEndpoints(svc, endpoints, nsc.podCidr) {
|
||||
if svc.local && !hasActiveEndpoints(svc, endpoints) {
|
||||
glog.V(1).Infof("Skipping service %s/%s as it does not have active endpoints\n", svc.namespace, svc.name)
|
||||
continue
|
||||
}
|
||||
@ -689,8 +674,7 @@ func (nsc *NetworkServicesController) syncIpvsServices(serviceInfoMap serviceInf
|
||||
|
||||
activeServiceEndpointMap[externalIpServiceId] = make([]string, 0)
|
||||
for _, endpoint := range endpoints {
|
||||
isLocal, _ := isLocalEndpoint(endpoint.ip, nsc.podCidr)
|
||||
if !svc.local || (svc.local && isLocal) {
|
||||
if !svc.local || (svc.local && endpoint.isLocal) {
|
||||
activeServiceEndpointMap[externalIpServiceId] = append(activeServiceEndpointMap[externalIpServiceId], endpoint.ip)
|
||||
}
|
||||
}
|
||||
@ -705,37 +689,39 @@ func (nsc *NetworkServicesController) syncIpvsServices(serviceInfoMap serviceInf
|
||||
Weight: 1,
|
||||
}
|
||||
|
||||
err := nsc.ln.ipvsAddServer(ipvsClusterVipSvc, &dst, svc.local, nsc.podCidr)
|
||||
if err != nil {
|
||||
glog.Errorf(err.Error())
|
||||
}
|
||||
|
||||
isLocal, err := isLocalEndpoint(endpoint.ip, nsc.podCidr)
|
||||
if !svc.local || (svc.local && isLocal) {
|
||||
activeServiceEndpointMap[clusterServiceId] = append(activeServiceEndpointMap[clusterServiceId], endpoint.ip)
|
||||
if !svc.local || (svc.local && endpoint.isLocal) {
|
||||
err := nsc.ln.ipvsAddServer(ipvsClusterVipSvc, &dst)
|
||||
if err != nil {
|
||||
glog.Errorf(err.Error())
|
||||
} else {
|
||||
activeServiceEndpointMap[clusterServiceId] = append(activeServiceEndpointMap[clusterServiceId], endpoint.ip)
|
||||
}
|
||||
}
|
||||
|
||||
if svc.nodePort != 0 {
|
||||
for i := 0; i < len(ipvsNodeportSvcs); i++ {
|
||||
err := nsc.ln.ipvsAddServer(ipvsNodeportSvcs[i], &dst, svc.local, nsc.podCidr)
|
||||
if err != nil {
|
||||
glog.Errorf(err.Error())
|
||||
}
|
||||
|
||||
if !svc.local || (svc.local && isLocal) {
|
||||
activeServiceEndpointMap[nodeServiceIds[i]] = append(activeServiceEndpointMap[clusterServiceId], endpoint.ip)
|
||||
if !svc.local || (svc.local && endpoint.isLocal) {
|
||||
err := nsc.ln.ipvsAddServer(ipvsNodeportSvcs[i], &dst)
|
||||
if err != nil {
|
||||
glog.Errorf(err.Error())
|
||||
} else {
|
||||
activeServiceEndpointMap[nodeServiceIds[i]] = append(activeServiceEndpointMap[nodeServiceIds[i]], endpoint.ip)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for _, externalIpService := range externalIpServices {
|
||||
if svc.local && !endpoint.isLocal {
|
||||
continue
|
||||
}
|
||||
|
||||
if svc.directServerReturn && svc.directServerReturnMethod == "tunnel" {
|
||||
dst.ConnectionFlags = ipvs.ConnectionFlagTunnel
|
||||
}
|
||||
|
||||
// add server to IPVS service
|
||||
err := nsc.ln.ipvsAddServer(externalIpService.ipvsSvc, &dst, svc.local, nsc.podCidr)
|
||||
err := nsc.ln.ipvsAddServer(externalIpService.ipvsSvc, &dst)
|
||||
if err != nil {
|
||||
glog.Errorf(err.Error())
|
||||
}
|
||||
@ -871,17 +857,6 @@ func (nsc *NetworkServicesController) syncIpvsServices(serviceInfoMap serviceInf
|
||||
return nil
|
||||
}
|
||||
|
||||
func isLocalEndpoint(ip, podCidr string) (bool, error) {
|
||||
_, ipnet, err := net.ParseCIDR(podCidr)
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
if ipnet.Contains(net.ParseIP(ip)) {
|
||||
return true, nil
|
||||
}
|
||||
return false, nil
|
||||
}
|
||||
|
||||
func (nsc *NetworkServicesController) getPodObjectForEndpoint(endpointIP string) (*api.Pod, error) {
|
||||
for _, obj := range nsc.podLister.List() {
|
||||
pod := obj.(*api.Pod)
|
||||
@ -1145,7 +1120,8 @@ func (nsc *NetworkServicesController) buildEndpointsInfo() endpointsInfoMap {
|
||||
svcId := generateServiceId(ep.Namespace, ep.Name, port.Name)
|
||||
endpoints := make([]endpointsInfo, 0)
|
||||
for _, addr := range epSubset.Addresses {
|
||||
endpoints = append(endpoints, endpointsInfo{ip: addr.IP, port: int(port.Port)})
|
||||
isLocal := addr.NodeName != nil && *addr.NodeName == nsc.nodeHostName
|
||||
endpoints = append(endpoints, endpointsInfo{ip: addr.IP, port: int(port.Port), isLocal: isLocal})
|
||||
}
|
||||
endpointsMap[svcId] = shuffle(endpoints)
|
||||
}
|
||||
@ -1581,20 +1557,7 @@ func (ln *linuxNetworking) ipvsAddFWMarkService(vip net.IP, protocol, port uint1
|
||||
return &svc, nil
|
||||
}
|
||||
|
||||
func (ln *linuxNetworking) ipvsAddServer(service *ipvs.Service, dest *ipvs.Destination, local bool, podCidr string) error {
|
||||
//for service.local enabled svc, only forward traffic to the pod on local node
|
||||
if local {
|
||||
_, ipnet, err := net.ParseCIDR(podCidr)
|
||||
if err != nil {
|
||||
glog.Infof("Failed to ParseCIDR %s for adding destination %s to the service %s",
|
||||
podCidr, ipvsDestinationString(dest), ipvsServiceString(service))
|
||||
return nil
|
||||
}
|
||||
if !ipnet.Contains(dest.Address) {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
func (ln *linuxNetworking) ipvsAddServer(service *ipvs.Service, dest *ipvs.Destination) error {
|
||||
err := ln.ipvsNewDestination(service, dest)
|
||||
if err == nil {
|
||||
glog.V(2).Infof("Successfully added destination %s to the service %s",
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// Code generated by moq; DO NOT EDIT
|
||||
// Code generated by moq; DO NOT EDIT.
|
||||
// github.com/matryer/moq
|
||||
|
||||
package proxy
|
||||
@ -52,7 +52,7 @@ var (
|
||||
// ipvsAddFWMarkServiceFunc: func(vip net.IP, protocol uint16, port uint16, persistent bool, scheduler string) (*ipvs.Service, error) {
|
||||
// panic("TODO: mock out the ipvsAddFWMarkService method")
|
||||
// },
|
||||
// ipvsAddServerFunc: func(ipvsSvc *ipvs.Service, ipvsDst *ipvs.Destination, local bool, podCidr string) error {
|
||||
// ipvsAddServerFunc: func(ipvsSvc *ipvs.Service, ipvsDst *ipvs.Destination) error {
|
||||
// panic("TODO: mock out the ipvsAddServer method")
|
||||
// },
|
||||
// ipvsAddServiceFunc: func(svcs []*ipvs.Service, vip net.IP, protocol uint16, port uint16, persistent bool, scheduler string) (*ipvs.Service, error) {
|
||||
@ -114,7 +114,7 @@ type LinuxNetworkingMock struct {
|
||||
ipvsAddFWMarkServiceFunc func(vip net.IP, protocol uint16, port uint16, persistent bool, scheduler string) (*ipvs.Service, error)
|
||||
|
||||
// ipvsAddServerFunc mocks the ipvsAddServer method.
|
||||
ipvsAddServerFunc func(ipvsSvc *ipvs.Service, ipvsDst *ipvs.Destination, local bool, podCidr string) error
|
||||
ipvsAddServerFunc func(ipvsSvc *ipvs.Service, ipvsDst *ipvs.Destination) error
|
||||
|
||||
// ipvsAddServiceFunc mocks the ipvsAddService method.
|
||||
ipvsAddServiceFunc func(svcs []*ipvs.Service, vip net.IP, protocol uint16, port uint16, persistent bool, scheduler string) (*ipvs.Service, error)
|
||||
@ -203,10 +203,6 @@ type LinuxNetworkingMock struct {
|
||||
IpvsSvc *ipvs.Service
|
||||
// IpvsDst is the ipvsDst argument value.
|
||||
IpvsDst *ipvs.Destination
|
||||
// Local is the local argument value.
|
||||
Local bool
|
||||
// PodCidr is the podCidr argument value.
|
||||
PodCidr string
|
||||
}
|
||||
// ipvsAddService holds details about calls to the ipvsAddService method.
|
||||
ipvsAddService []struct {
|
||||
@ -290,7 +286,7 @@ type LinuxNetworkingMock struct {
|
||||
// cleanupMangleTableRule calls cleanupMangleTableRuleFunc.
|
||||
func (mock *LinuxNetworkingMock) cleanupMangleTableRule(ip string, protocol string, port string, fwmark string) error {
|
||||
if mock.cleanupMangleTableRuleFunc == nil {
|
||||
panic("moq: LinuxNetworkingMock.cleanupMangleTableRuleFunc is nil but LinuxNetworking.cleanupMangleTableRule was just called")
|
||||
panic("LinuxNetworkingMock.cleanupMangleTableRuleFunc: method is nil but LinuxNetworking.cleanupMangleTableRule was just called")
|
||||
}
|
||||
callInfo := struct {
|
||||
IP string
|
||||
@ -333,7 +329,7 @@ func (mock *LinuxNetworkingMock) cleanupMangleTableRuleCalls() []struct {
|
||||
// getKubeDummyInterface calls getKubeDummyInterfaceFunc.
|
||||
func (mock *LinuxNetworkingMock) getKubeDummyInterface() (netlink.Link, error) {
|
||||
if mock.getKubeDummyInterfaceFunc == nil {
|
||||
panic("moq: LinuxNetworkingMock.getKubeDummyInterfaceFunc is nil but LinuxNetworking.getKubeDummyInterface was just called")
|
||||
panic("LinuxNetworkingMock.getKubeDummyInterfaceFunc: method is nil but LinuxNetworking.getKubeDummyInterface was just called")
|
||||
}
|
||||
callInfo := struct {
|
||||
}{}
|
||||
@ -359,7 +355,7 @@ func (mock *LinuxNetworkingMock) getKubeDummyInterfaceCalls() []struct {
|
||||
// ipAddrAdd calls ipAddrAddFunc.
|
||||
func (mock *LinuxNetworkingMock) ipAddrAdd(iface netlink.Link, ip string, addRoute bool) error {
|
||||
if mock.ipAddrAddFunc == nil {
|
||||
panic("moq: LinuxNetworkingMock.ipAddrAddFunc is nil but LinuxNetworking.ipAddrAdd was just called")
|
||||
panic("LinuxNetworkingMock.ipAddrAddFunc: method is nil but LinuxNetworking.ipAddrAdd was just called")
|
||||
}
|
||||
callInfo := struct {
|
||||
Iface netlink.Link
|
||||
@ -398,7 +394,7 @@ func (mock *LinuxNetworkingMock) ipAddrAddCalls() []struct {
|
||||
// ipAddrDel calls ipAddrDelFunc.
|
||||
func (mock *LinuxNetworkingMock) ipAddrDel(iface netlink.Link, ip string) error {
|
||||
if mock.ipAddrDelFunc == nil {
|
||||
panic("moq: LinuxNetworkingMock.ipAddrDelFunc is nil but LinuxNetworking.ipAddrDel was just called")
|
||||
panic("LinuxNetworkingMock.ipAddrDelFunc: method is nil but LinuxNetworking.ipAddrDel was just called")
|
||||
}
|
||||
callInfo := struct {
|
||||
Iface netlink.Link
|
||||
@ -433,7 +429,7 @@ func (mock *LinuxNetworkingMock) ipAddrDelCalls() []struct {
|
||||
// ipvsAddFWMarkService calls ipvsAddFWMarkServiceFunc.
|
||||
func (mock *LinuxNetworkingMock) ipvsAddFWMarkService(vip net.IP, protocol uint16, port uint16, persistent bool, scheduler string) (*ipvs.Service, error) {
|
||||
if mock.ipvsAddFWMarkServiceFunc == nil {
|
||||
panic("moq: LinuxNetworkingMock.ipvsAddFWMarkServiceFunc is nil but LinuxNetworking.ipvsAddFWMarkService was just called")
|
||||
panic("LinuxNetworkingMock.ipvsAddFWMarkServiceFunc: method is nil but LinuxNetworking.ipvsAddFWMarkService was just called")
|
||||
}
|
||||
callInfo := struct {
|
||||
Vip net.IP
|
||||
@ -478,25 +474,21 @@ func (mock *LinuxNetworkingMock) ipvsAddFWMarkServiceCalls() []struct {
|
||||
}
|
||||
|
||||
// ipvsAddServer calls ipvsAddServerFunc.
|
||||
func (mock *LinuxNetworkingMock) ipvsAddServer(ipvsSvc *ipvs.Service, ipvsDst *ipvs.Destination, local bool, podCidr string) error {
|
||||
func (mock *LinuxNetworkingMock) ipvsAddServer(ipvsSvc *ipvs.Service, ipvsDst *ipvs.Destination) error {
|
||||
if mock.ipvsAddServerFunc == nil {
|
||||
panic("moq: LinuxNetworkingMock.ipvsAddServerFunc is nil but LinuxNetworking.ipvsAddServer was just called")
|
||||
panic("LinuxNetworkingMock.ipvsAddServerFunc: method is nil but LinuxNetworking.ipvsAddServer was just called")
|
||||
}
|
||||
callInfo := struct {
|
||||
IpvsSvc *ipvs.Service
|
||||
IpvsDst *ipvs.Destination
|
||||
Local bool
|
||||
PodCidr string
|
||||
}{
|
||||
IpvsSvc: ipvsSvc,
|
||||
IpvsDst: ipvsDst,
|
||||
Local: local,
|
||||
PodCidr: podCidr,
|
||||
}
|
||||
lockLinuxNetworkingMockipvsAddServer.Lock()
|
||||
mock.calls.ipvsAddServer = append(mock.calls.ipvsAddServer, callInfo)
|
||||
lockLinuxNetworkingMockipvsAddServer.Unlock()
|
||||
return mock.ipvsAddServerFunc(ipvsSvc, ipvsDst, local, podCidr)
|
||||
return mock.ipvsAddServerFunc(ipvsSvc, ipvsDst)
|
||||
}
|
||||
|
||||
// ipvsAddServerCalls gets all the calls that were made to ipvsAddServer.
|
||||
@ -505,14 +497,10 @@ func (mock *LinuxNetworkingMock) ipvsAddServer(ipvsSvc *ipvs.Service, ipvsDst *i
|
||||
func (mock *LinuxNetworkingMock) ipvsAddServerCalls() []struct {
|
||||
IpvsSvc *ipvs.Service
|
||||
IpvsDst *ipvs.Destination
|
||||
Local bool
|
||||
PodCidr string
|
||||
} {
|
||||
var calls []struct {
|
||||
IpvsSvc *ipvs.Service
|
||||
IpvsDst *ipvs.Destination
|
||||
Local bool
|
||||
PodCidr string
|
||||
}
|
||||
lockLinuxNetworkingMockipvsAddServer.RLock()
|
||||
calls = mock.calls.ipvsAddServer
|
||||
@ -523,7 +511,7 @@ func (mock *LinuxNetworkingMock) ipvsAddServerCalls() []struct {
|
||||
// ipvsAddService calls ipvsAddServiceFunc.
|
||||
func (mock *LinuxNetworkingMock) ipvsAddService(svcs []*ipvs.Service, vip net.IP, protocol uint16, port uint16, persistent bool, scheduler string) (*ipvs.Service, error) {
|
||||
if mock.ipvsAddServiceFunc == nil {
|
||||
panic("moq: LinuxNetworkingMock.ipvsAddServiceFunc is nil but LinuxNetworking.ipvsAddService was just called")
|
||||
panic("LinuxNetworkingMock.ipvsAddServiceFunc: method is nil but LinuxNetworking.ipvsAddService was just called")
|
||||
}
|
||||
callInfo := struct {
|
||||
Svcs []*ipvs.Service
|
||||
@ -574,7 +562,7 @@ func (mock *LinuxNetworkingMock) ipvsAddServiceCalls() []struct {
|
||||
// ipvsDelDestination calls ipvsDelDestinationFunc.
|
||||
func (mock *LinuxNetworkingMock) ipvsDelDestination(ipvsSvc *ipvs.Service, ipvsDst *ipvs.Destination) error {
|
||||
if mock.ipvsDelDestinationFunc == nil {
|
||||
panic("moq: LinuxNetworkingMock.ipvsDelDestinationFunc is nil but LinuxNetworking.ipvsDelDestination was just called")
|
||||
panic("LinuxNetworkingMock.ipvsDelDestinationFunc: method is nil but LinuxNetworking.ipvsDelDestination was just called")
|
||||
}
|
||||
callInfo := struct {
|
||||
IpvsSvc *ipvs.Service
|
||||
@ -609,7 +597,7 @@ func (mock *LinuxNetworkingMock) ipvsDelDestinationCalls() []struct {
|
||||
// ipvsDelService calls ipvsDelServiceFunc.
|
||||
func (mock *LinuxNetworkingMock) ipvsDelService(ipvsSvc *ipvs.Service) error {
|
||||
if mock.ipvsDelServiceFunc == nil {
|
||||
panic("moq: LinuxNetworkingMock.ipvsDelServiceFunc is nil but LinuxNetworking.ipvsDelService was just called")
|
||||
panic("LinuxNetworkingMock.ipvsDelServiceFunc: method is nil but LinuxNetworking.ipvsDelService was just called")
|
||||
}
|
||||
callInfo := struct {
|
||||
IpvsSvc *ipvs.Service
|
||||
@ -640,7 +628,7 @@ func (mock *LinuxNetworkingMock) ipvsDelServiceCalls() []struct {
|
||||
// ipvsGetDestinations calls ipvsGetDestinationsFunc.
|
||||
func (mock *LinuxNetworkingMock) ipvsGetDestinations(ipvsSvc *ipvs.Service) ([]*ipvs.Destination, error) {
|
||||
if mock.ipvsGetDestinationsFunc == nil {
|
||||
panic("moq: LinuxNetworkingMock.ipvsGetDestinationsFunc is nil but LinuxNetworking.ipvsGetDestinations was just called")
|
||||
panic("LinuxNetworkingMock.ipvsGetDestinationsFunc: method is nil but LinuxNetworking.ipvsGetDestinations was just called")
|
||||
}
|
||||
callInfo := struct {
|
||||
IpvsSvc *ipvs.Service
|
||||
@ -671,7 +659,7 @@ func (mock *LinuxNetworkingMock) ipvsGetDestinationsCalls() []struct {
|
||||
// ipvsGetServices calls ipvsGetServicesFunc.
|
||||
func (mock *LinuxNetworkingMock) ipvsGetServices() ([]*ipvs.Service, error) {
|
||||
if mock.ipvsGetServicesFunc == nil {
|
||||
panic("moq: LinuxNetworkingMock.ipvsGetServicesFunc is nil but LinuxNetworking.ipvsGetServices was just called")
|
||||
panic("LinuxNetworkingMock.ipvsGetServicesFunc: method is nil but LinuxNetworking.ipvsGetServices was just called")
|
||||
}
|
||||
callInfo := struct {
|
||||
}{}
|
||||
@ -697,7 +685,7 @@ func (mock *LinuxNetworkingMock) ipvsGetServicesCalls() []struct {
|
||||
// ipvsNewDestination calls ipvsNewDestinationFunc.
|
||||
func (mock *LinuxNetworkingMock) ipvsNewDestination(ipvsSvc *ipvs.Service, ipvsDst *ipvs.Destination) error {
|
||||
if mock.ipvsNewDestinationFunc == nil {
|
||||
panic("moq: LinuxNetworkingMock.ipvsNewDestinationFunc is nil but LinuxNetworking.ipvsNewDestination was just called")
|
||||
panic("LinuxNetworkingMock.ipvsNewDestinationFunc: method is nil but LinuxNetworking.ipvsNewDestination was just called")
|
||||
}
|
||||
callInfo := struct {
|
||||
IpvsSvc *ipvs.Service
|
||||
@ -732,7 +720,7 @@ func (mock *LinuxNetworkingMock) ipvsNewDestinationCalls() []struct {
|
||||
// ipvsNewService calls ipvsNewServiceFunc.
|
||||
func (mock *LinuxNetworkingMock) ipvsNewService(ipvsSvc *ipvs.Service) error {
|
||||
if mock.ipvsNewServiceFunc == nil {
|
||||
panic("moq: LinuxNetworkingMock.ipvsNewServiceFunc is nil but LinuxNetworking.ipvsNewService was just called")
|
||||
panic("LinuxNetworkingMock.ipvsNewServiceFunc: method is nil but LinuxNetworking.ipvsNewService was just called")
|
||||
}
|
||||
callInfo := struct {
|
||||
IpvsSvc *ipvs.Service
|
||||
@ -763,7 +751,7 @@ func (mock *LinuxNetworkingMock) ipvsNewServiceCalls() []struct {
|
||||
// ipvsUpdateDestination calls ipvsUpdateDestinationFunc.
|
||||
func (mock *LinuxNetworkingMock) ipvsUpdateDestination(ipvsSvc *ipvs.Service, ipvsDst *ipvs.Destination) error {
|
||||
if mock.ipvsUpdateDestinationFunc == nil {
|
||||
panic("moq: LinuxNetworkingMock.ipvsUpdateDestinationFunc is nil but LinuxNetworking.ipvsUpdateDestination was just called")
|
||||
panic("LinuxNetworkingMock.ipvsUpdateDestinationFunc: method is nil but LinuxNetworking.ipvsUpdateDestination was just called")
|
||||
}
|
||||
callInfo := struct {
|
||||
IpvsSvc *ipvs.Service
|
||||
@ -798,7 +786,7 @@ func (mock *LinuxNetworkingMock) ipvsUpdateDestinationCalls() []struct {
|
||||
// ipvsUpdateService calls ipvsUpdateServiceFunc.
|
||||
func (mock *LinuxNetworkingMock) ipvsUpdateService(ipvsSvc *ipvs.Service) error {
|
||||
if mock.ipvsUpdateServiceFunc == nil {
|
||||
panic("moq: LinuxNetworkingMock.ipvsUpdateServiceFunc is nil but LinuxNetworking.ipvsUpdateService was just called")
|
||||
panic("LinuxNetworkingMock.ipvsUpdateServiceFunc: method is nil but LinuxNetworking.ipvsUpdateService was just called")
|
||||
}
|
||||
callInfo := struct {
|
||||
IpvsSvc *ipvs.Service
|
||||
@ -829,7 +817,7 @@ func (mock *LinuxNetworkingMock) ipvsUpdateServiceCalls() []struct {
|
||||
// prepareEndpointForDsr calls prepareEndpointForDsrFunc.
|
||||
func (mock *LinuxNetworkingMock) prepareEndpointForDsr(containerId string, endpointIP string, vip string) error {
|
||||
if mock.prepareEndpointForDsrFunc == nil {
|
||||
panic("moq: LinuxNetworkingMock.prepareEndpointForDsrFunc is nil but LinuxNetworking.prepareEndpointForDsr was just called")
|
||||
panic("LinuxNetworkingMock.prepareEndpointForDsrFunc: method is nil but LinuxNetworking.prepareEndpointForDsr was just called")
|
||||
}
|
||||
callInfo := struct {
|
||||
ContainerId string
|
||||
@ -868,7 +856,7 @@ func (mock *LinuxNetworkingMock) prepareEndpointForDsrCalls() []struct {
|
||||
// setupPolicyRoutingForDSR calls setupPolicyRoutingForDSRFunc.
|
||||
func (mock *LinuxNetworkingMock) setupPolicyRoutingForDSR() error {
|
||||
if mock.setupPolicyRoutingForDSRFunc == nil {
|
||||
panic("moq: LinuxNetworkingMock.setupPolicyRoutingForDSRFunc is nil but LinuxNetworking.setupPolicyRoutingForDSR was just called")
|
||||
panic("LinuxNetworkingMock.setupPolicyRoutingForDSRFunc: method is nil but LinuxNetworking.setupPolicyRoutingForDSR was just called")
|
||||
}
|
||||
callInfo := struct {
|
||||
}{}
|
||||
@ -894,7 +882,7 @@ func (mock *LinuxNetworkingMock) setupPolicyRoutingForDSRCalls() []struct {
|
||||
// setupRoutesForExternalIPForDSR calls setupRoutesForExternalIPForDSRFunc.
|
||||
func (mock *LinuxNetworkingMock) setupRoutesForExternalIPForDSR(in1 serviceInfoMap) error {
|
||||
if mock.setupRoutesForExternalIPForDSRFunc == nil {
|
||||
panic("moq: LinuxNetworkingMock.setupRoutesForExternalIPForDSRFunc is nil but LinuxNetworking.setupRoutesForExternalIPForDSR was just called")
|
||||
panic("LinuxNetworkingMock.setupRoutesForExternalIPForDSRFunc: method is nil but LinuxNetworking.setupRoutesForExternalIPForDSR was just called")
|
||||
}
|
||||
callInfo := struct {
|
||||
In1 serviceInfoMap
|
||||
|
||||
@ -49,7 +49,7 @@ func (lnm *LinuxNetworkingMockImpl) ipvsGetServices() ([]*ipvs.Service, error) {
|
||||
func (lnm *LinuxNetworkingMockImpl) ipAddrAdd(iface netlink.Link, addr string, addRouter bool) error {
|
||||
return nil
|
||||
}
|
||||
func (lnm *LinuxNetworkingMockImpl) ipvsAddServer(ipvsSvc *ipvs.Service, ipvsDst *ipvs.Destination, local bool, podCidr string) error {
|
||||
func (lnm *LinuxNetworkingMockImpl) ipvsAddServer(ipvsSvc *ipvs.Service, ipvsDst *ipvs.Destination) error {
|
||||
return nil
|
||||
}
|
||||
func (lnm *LinuxNetworkingMockImpl) ipvsAddService(svcs []*ipvs.Service, vip net.IP, protocol, port uint16, persistent bool, scheduler string) (*ipvs.Service, error) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user