Kubeproxy uses V1 EndpointSlice

This commit is contained in:
Swetha Repakula
2021-06-28 19:16:55 -07:00
parent 92726bf0f3
commit 03b7a699c2
16 changed files with 184 additions and 160 deletions

View File

@@ -31,7 +31,7 @@ import (
"github.com/Microsoft/hcsshim"
"github.com/Microsoft/hcsshim/hcn"
discovery "k8s.io/api/discovery/v1beta1"
discovery "k8s.io/api/discovery/v1"
"github.com/davecgh/go-spew/spew"
v1 "k8s.io/api/core/v1"
@@ -197,11 +197,6 @@ func (info *endpointsInfo) IsTerminating() bool {
return info.terminating
}
// GetTopology returns the topology information of the endpoint.
func (info *endpointsInfo) GetTopology() map[string]string {
return nil
}
// GetZoneHint returns the zone hint for the endpoint.
func (info *endpointsInfo) GetZoneHints() sets.String {
return sets.String{}
@@ -222,6 +217,16 @@ func (info *endpointsInfo) Equal(other proxy.Endpoint) bool {
return info.String() == other.String() && info.GetIsLocal() == other.GetIsLocal()
}
// GetNodeName returns the NodeName for this endpoint.
func (info *endpointsInfo) GetNodeName() string {
return ""
}
// GetZone returns the Zone for this endpoint.
func (info *endpointsInfo) GetZone() string {
return ""
}
//Uses mac prefix and IPv4 address to return a mac address
//This ensures mac addresses are unique for proper load balancing
//There is a possibility of MAC collisions but this Mac address is used for remote endpoints only

View File

@@ -20,18 +20,19 @@ package winkernel
import (
"fmt"
"k8s.io/api/core/v1"
discovery "k8s.io/api/discovery/v1beta1"
"net"
"strings"
"testing"
"time"
v1 "k8s.io/api/core/v1"
discovery "k8s.io/api/discovery/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"
"k8s.io/apimachinery/pkg/util/intstr"
"k8s.io/kubernetes/pkg/proxy"
"k8s.io/kubernetes/pkg/proxy/healthcheck"
utilpointer "k8s.io/utils/pointer"
"net"
"strings"
"testing"
"time"
)
const (
@@ -810,7 +811,7 @@ func TestEndpointSlice(t *testing.T) {
Endpoints: []discovery.Endpoint{{
Addresses: []string{"192.168.2.3"},
Conditions: discovery.EndpointConditions{Ready: utilpointer.BoolPtr(true)},
Topology: map[string]string{"kubernetes.io/hostname": "testhost2"},
NodeName: utilpointer.StringPtr("testhost2"),
}},
}