|
|
@@ -54,7 +54,7 @@ func TestGetLocalEndpointIPs(t *testing.T) {
|
|
|
|
// Case[1]: unnamed port
|
|
|
|
// Case[1]: unnamed port
|
|
|
|
endpointsMap: EndpointsMap{
|
|
|
|
endpointsMap: EndpointsMap{
|
|
|
|
makeServicePortName("ns1", "ep1", "", v1.ProtocolTCP): []Endpoint{
|
|
|
|
makeServicePortName("ns1", "ep1", "", v1.ProtocolTCP): []Endpoint{
|
|
|
|
&BaseEndpointInfo{endpoint: "1.1.1.1:11", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{ip: "1.1.1.1", port: 11, endpoint: "1.1.1.1:11", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
expected: map[types.NamespacedName]sets.Set[string]{},
|
|
|
|
expected: map[types.NamespacedName]sets.Set[string]{},
|
|
|
@@ -62,7 +62,7 @@ func TestGetLocalEndpointIPs(t *testing.T) {
|
|
|
|
// Case[2]: unnamed port local
|
|
|
|
// Case[2]: unnamed port local
|
|
|
|
endpointsMap: EndpointsMap{
|
|
|
|
endpointsMap: EndpointsMap{
|
|
|
|
makeServicePortName("ns1", "ep1", "", v1.ProtocolTCP): []Endpoint{
|
|
|
|
makeServicePortName("ns1", "ep1", "", v1.ProtocolTCP): []Endpoint{
|
|
|
|
&BaseEndpointInfo{endpoint: "1.1.1.1:11", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{ip: "1.1.1.1", port: 11, endpoint: "1.1.1.1:11", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
expected: map[types.NamespacedName]sets.Set[string]{
|
|
|
|
expected: map[types.NamespacedName]sets.Set[string]{
|
|
|
@@ -72,12 +72,12 @@ func TestGetLocalEndpointIPs(t *testing.T) {
|
|
|
|
// Case[3]: named local and non-local ports for the same IP.
|
|
|
|
// Case[3]: named local and non-local ports for the same IP.
|
|
|
|
endpointsMap: EndpointsMap{
|
|
|
|
endpointsMap: EndpointsMap{
|
|
|
|
makeServicePortName("ns1", "ep1", "p11", v1.ProtocolTCP): []Endpoint{
|
|
|
|
makeServicePortName("ns1", "ep1", "p11", v1.ProtocolTCP): []Endpoint{
|
|
|
|
&BaseEndpointInfo{endpoint: "1.1.1.1:11", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{ip: "1.1.1.1", port: 11, endpoint: "1.1.1.1:11", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{endpoint: "1.1.1.2:11", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{ip: "1.1.1.2", port: 11, endpoint: "1.1.1.2:11", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
makeServicePortName("ns1", "ep1", "p12", v1.ProtocolTCP): []Endpoint{
|
|
|
|
makeServicePortName("ns1", "ep1", "p12", v1.ProtocolTCP): []Endpoint{
|
|
|
|
&BaseEndpointInfo{endpoint: "1.1.1.1:12", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{ip: "1.1.1.1", port: 12, endpoint: "1.1.1.1:12", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{endpoint: "1.1.1.2:12", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{ip: "1.1.1.2", port: 12, endpoint: "1.1.1.2:12", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
expected: map[types.NamespacedName]sets.Set[string]{
|
|
|
|
expected: map[types.NamespacedName]sets.Set[string]{
|
|
|
@@ -87,21 +87,21 @@ func TestGetLocalEndpointIPs(t *testing.T) {
|
|
|
|
// Case[4]: named local and non-local ports for different IPs.
|
|
|
|
// Case[4]: named local and non-local ports for different IPs.
|
|
|
|
endpointsMap: EndpointsMap{
|
|
|
|
endpointsMap: EndpointsMap{
|
|
|
|
makeServicePortName("ns1", "ep1", "p11", v1.ProtocolTCP): []Endpoint{
|
|
|
|
makeServicePortName("ns1", "ep1", "p11", v1.ProtocolTCP): []Endpoint{
|
|
|
|
&BaseEndpointInfo{endpoint: "1.1.1.1:11", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{ip: "1.1.1.1", port: 11, endpoint: "1.1.1.1:11", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
makeServicePortName("ns2", "ep2", "p22", v1.ProtocolTCP): []Endpoint{
|
|
|
|
makeServicePortName("ns2", "ep2", "p22", v1.ProtocolTCP): []Endpoint{
|
|
|
|
&BaseEndpointInfo{endpoint: "2.2.2.2:22", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{ip: "2.2.2.2", port: 22, endpoint: "2.2.2.2:22", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{endpoint: "2.2.2.22:22", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{ip: "2.2.2.22", port: 22, endpoint: "2.2.2.22:22", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
makeServicePortName("ns2", "ep2", "p23", v1.ProtocolTCP): []Endpoint{
|
|
|
|
makeServicePortName("ns2", "ep2", "p23", v1.ProtocolTCP): []Endpoint{
|
|
|
|
&BaseEndpointInfo{endpoint: "2.2.2.3:23", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{ip: "2.2.2.3", port: 23, endpoint: "2.2.2.3:23", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
makeServicePortName("ns4", "ep4", "p44", v1.ProtocolTCP): []Endpoint{
|
|
|
|
makeServicePortName("ns4", "ep4", "p44", v1.ProtocolTCP): []Endpoint{
|
|
|
|
&BaseEndpointInfo{endpoint: "4.4.4.4:44", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{ip: "4.4.4.4", port: 44, endpoint: "4.4.4.4:44", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{endpoint: "4.4.4.5:44", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{ip: "4.4.4.5", port: 44, endpoint: "4.4.4.5:44", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
makeServicePortName("ns4", "ep4", "p45", v1.ProtocolTCP): []Endpoint{
|
|
|
|
makeServicePortName("ns4", "ep4", "p45", v1.ProtocolTCP): []Endpoint{
|
|
|
|
&BaseEndpointInfo{endpoint: "4.4.4.6:45", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{ip: "4.4.4.6", port: 45, endpoint: "4.4.4.6:45", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
expected: map[types.NamespacedName]sets.Set[string]{
|
|
|
|
expected: map[types.NamespacedName]sets.Set[string]{
|
|
|
@@ -112,21 +112,21 @@ func TestGetLocalEndpointIPs(t *testing.T) {
|
|
|
|
// Case[5]: named local and non-local ports for different IPs, some not ready.
|
|
|
|
// Case[5]: named local and non-local ports for different IPs, some not ready.
|
|
|
|
endpointsMap: EndpointsMap{
|
|
|
|
endpointsMap: EndpointsMap{
|
|
|
|
makeServicePortName("ns1", "ep1", "p11", v1.ProtocolTCP): []Endpoint{
|
|
|
|
makeServicePortName("ns1", "ep1", "p11", v1.ProtocolTCP): []Endpoint{
|
|
|
|
&BaseEndpointInfo{endpoint: "1.1.1.1:11", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{ip: "1.1.1.1", port: 11, endpoint: "1.1.1.1:11", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
makeServicePortName("ns2", "ep2", "p22", v1.ProtocolTCP): []Endpoint{
|
|
|
|
makeServicePortName("ns2", "ep2", "p22", v1.ProtocolTCP): []Endpoint{
|
|
|
|
&BaseEndpointInfo{endpoint: "2.2.2.2:22", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{ip: "2.2.2.2", port: 22, endpoint: "2.2.2.2:22", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{endpoint: "2.2.2.22:22", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{ip: "2.2.2.22", port: 22, endpoint: "2.2.2.22:22", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
makeServicePortName("ns2", "ep2", "p23", v1.ProtocolTCP): []Endpoint{
|
|
|
|
makeServicePortName("ns2", "ep2", "p23", v1.ProtocolTCP): []Endpoint{
|
|
|
|
&BaseEndpointInfo{endpoint: "2.2.2.3:23", isLocal: true, ready: false, serving: true, terminating: true},
|
|
|
|
&BaseEndpointInfo{ip: "2.2.2.3", port: 23, endpoint: "2.2.2.3:23", isLocal: true, ready: false, serving: true, terminating: true},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
makeServicePortName("ns4", "ep4", "p44", v1.ProtocolTCP): []Endpoint{
|
|
|
|
makeServicePortName("ns4", "ep4", "p44", v1.ProtocolTCP): []Endpoint{
|
|
|
|
&BaseEndpointInfo{endpoint: "4.4.4.4:44", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{ip: "4.4.4.4", port: 44, endpoint: "4.4.4.4:44", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{endpoint: "4.4.4.5:44", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{ip: "4.4.4.5", port: 44, endpoint: "4.4.4.5:44", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
makeServicePortName("ns4", "ep4", "p45", v1.ProtocolTCP): []Endpoint{
|
|
|
|
makeServicePortName("ns4", "ep4", "p45", v1.ProtocolTCP): []Endpoint{
|
|
|
|
&BaseEndpointInfo{endpoint: "4.4.4.6:45", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{ip: "4.4.4.6", port: 45, endpoint: "4.4.4.6:45", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
expected: map[types.NamespacedName]sets.Set[string]{
|
|
|
|
expected: map[types.NamespacedName]sets.Set[string]{
|
|
|
@@ -137,21 +137,21 @@ func TestGetLocalEndpointIPs(t *testing.T) {
|
|
|
|
// Case[6]: all endpoints are terminating,, so getLocalReadyEndpointIPs should return 0 ready endpoints
|
|
|
|
// Case[6]: all endpoints are terminating,, so getLocalReadyEndpointIPs should return 0 ready endpoints
|
|
|
|
endpointsMap: EndpointsMap{
|
|
|
|
endpointsMap: EndpointsMap{
|
|
|
|
makeServicePortName("ns1", "ep1", "p11", v1.ProtocolTCP): []Endpoint{
|
|
|
|
makeServicePortName("ns1", "ep1", "p11", v1.ProtocolTCP): []Endpoint{
|
|
|
|
&BaseEndpointInfo{endpoint: "1.1.1.1:11", isLocal: false, ready: false, serving: true, terminating: true},
|
|
|
|
&BaseEndpointInfo{ip: "1.1.1.1", port: 11, endpoint: "1.1.1.1:11", isLocal: false, ready: false, serving: true, terminating: true},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
makeServicePortName("ns2", "ep2", "p22", v1.ProtocolTCP): []Endpoint{
|
|
|
|
makeServicePortName("ns2", "ep2", "p22", v1.ProtocolTCP): []Endpoint{
|
|
|
|
&BaseEndpointInfo{endpoint: "2.2.2.2:22", isLocal: true, ready: false, serving: true, terminating: true},
|
|
|
|
&BaseEndpointInfo{ip: "2.2.2.2", port: 22, endpoint: "2.2.2.2:22", isLocal: true, ready: false, serving: true, terminating: true},
|
|
|
|
&BaseEndpointInfo{endpoint: "2.2.2.22:22", isLocal: true, ready: false, serving: true, terminating: true},
|
|
|
|
&BaseEndpointInfo{ip: "2.2.2.22", port: 22, endpoint: "2.2.2.22:22", isLocal: true, ready: false, serving: true, terminating: true},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
makeServicePortName("ns2", "ep2", "p23", v1.ProtocolTCP): []Endpoint{
|
|
|
|
makeServicePortName("ns2", "ep2", "p23", v1.ProtocolTCP): []Endpoint{
|
|
|
|
&BaseEndpointInfo{endpoint: "2.2.2.3:23", isLocal: true, ready: false, serving: true, terminating: true},
|
|
|
|
&BaseEndpointInfo{ip: "2.2.2.3", port: 23, endpoint: "2.2.2.3:23", isLocal: true, ready: false, serving: true, terminating: true},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
makeServicePortName("ns4", "ep4", "p44", v1.ProtocolTCP): []Endpoint{
|
|
|
|
makeServicePortName("ns4", "ep4", "p44", v1.ProtocolTCP): []Endpoint{
|
|
|
|
&BaseEndpointInfo{endpoint: "4.4.4.4:44", isLocal: true, ready: false, serving: true, terminating: true},
|
|
|
|
&BaseEndpointInfo{ip: "4.4.4.4", port: 44, endpoint: "4.4.4.4:44", isLocal: true, ready: false, serving: true, terminating: true},
|
|
|
|
&BaseEndpointInfo{endpoint: "4.4.4.5:44", isLocal: false, ready: false, serving: true, terminating: true},
|
|
|
|
&BaseEndpointInfo{ip: "4.4.4.5", port: 44, endpoint: "4.4.4.5:44", isLocal: false, ready: false, serving: true, terminating: true},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
makeServicePortName("ns4", "ep4", "p45", v1.ProtocolTCP): []Endpoint{
|
|
|
|
makeServicePortName("ns4", "ep4", "p45", v1.ProtocolTCP): []Endpoint{
|
|
|
|
&BaseEndpointInfo{endpoint: "4.4.4.6:45", isLocal: true, ready: false, serving: true, terminating: true},
|
|
|
|
&BaseEndpointInfo{ip: "4.4.4.6", port: 45, endpoint: "4.4.4.6:45", isLocal: true, ready: false, serving: true, terminating: true},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
expected: make(map[types.NamespacedName]sets.Set[string], 0),
|
|
|
|
expected: make(map[types.NamespacedName]sets.Set[string], 0),
|
|
|
@@ -555,12 +555,12 @@ func TestUpdateEndpointsMap(t *testing.T) {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
previousEndpointsMap: map[ServicePortName][]*BaseEndpointInfo{
|
|
|
|
previousEndpointsMap: map[ServicePortName][]*BaseEndpointInfo{
|
|
|
|
makeServicePortName("ns1", "ep1", "", v1.ProtocolUDP): {
|
|
|
|
makeServicePortName("ns1", "ep1", "", v1.ProtocolUDP): {
|
|
|
|
{endpoint: "1.1.1.1:11", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
{ip: "1.1.1.1", port: 11, endpoint: "1.1.1.1:11", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
expectedResult: map[ServicePortName][]*BaseEndpointInfo{
|
|
|
|
expectedResult: map[ServicePortName][]*BaseEndpointInfo{
|
|
|
|
makeServicePortName("ns1", "ep1", "", v1.ProtocolUDP): {
|
|
|
|
makeServicePortName("ns1", "ep1", "", v1.ProtocolUDP): {
|
|
|
|
{endpoint: "1.1.1.1:11", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
{ip: "1.1.1.1", port: 11, endpoint: "1.1.1.1:11", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
expectedDeletedUDPEndpoints: []ServiceEndpoint{},
|
|
|
|
expectedDeletedUDPEndpoints: []ServiceEndpoint{},
|
|
|
@@ -577,12 +577,12 @@ func TestUpdateEndpointsMap(t *testing.T) {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
previousEndpointsMap: map[ServicePortName][]*BaseEndpointInfo{
|
|
|
|
previousEndpointsMap: map[ServicePortName][]*BaseEndpointInfo{
|
|
|
|
makeServicePortName("ns1", "ep1", "p11", v1.ProtocolUDP): {
|
|
|
|
makeServicePortName("ns1", "ep1", "p11", v1.ProtocolUDP): {
|
|
|
|
{endpoint: "1.1.1.1:11", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
{ip: "1.1.1.1", port: 11, endpoint: "1.1.1.1:11", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
expectedResult: map[ServicePortName][]*BaseEndpointInfo{
|
|
|
|
expectedResult: map[ServicePortName][]*BaseEndpointInfo{
|
|
|
|
makeServicePortName("ns1", "ep1", "p11", v1.ProtocolUDP): {
|
|
|
|
makeServicePortName("ns1", "ep1", "p11", v1.ProtocolUDP): {
|
|
|
|
{endpoint: "1.1.1.1:11", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
{ip: "1.1.1.1", port: 11, endpoint: "1.1.1.1:11", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
expectedDeletedUDPEndpoints: []ServiceEndpoint{},
|
|
|
|
expectedDeletedUDPEndpoints: []ServiceEndpoint{},
|
|
|
@@ -603,18 +603,18 @@ func TestUpdateEndpointsMap(t *testing.T) {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
previousEndpointsMap: map[ServicePortName][]*BaseEndpointInfo{
|
|
|
|
previousEndpointsMap: map[ServicePortName][]*BaseEndpointInfo{
|
|
|
|
makeServicePortName("ns1", "ep1", "p11", v1.ProtocolUDP): {
|
|
|
|
makeServicePortName("ns1", "ep1", "p11", v1.ProtocolUDP): {
|
|
|
|
{endpoint: "1.1.1.1:11", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
{ip: "1.1.1.1", port: 11, endpoint: "1.1.1.1:11", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
makeServicePortName("ns1", "ep1", "p12", v1.ProtocolUDP): {
|
|
|
|
makeServicePortName("ns1", "ep1", "p12", v1.ProtocolUDP): {
|
|
|
|
{endpoint: "1.1.1.2:12", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
{ip: "1.1.1.2", port: 12, endpoint: "1.1.1.2:12", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
expectedResult: map[ServicePortName][]*BaseEndpointInfo{
|
|
|
|
expectedResult: map[ServicePortName][]*BaseEndpointInfo{
|
|
|
|
makeServicePortName("ns1", "ep1", "p11", v1.ProtocolUDP): {
|
|
|
|
makeServicePortName("ns1", "ep1", "p11", v1.ProtocolUDP): {
|
|
|
|
{endpoint: "1.1.1.1:11", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
{ip: "1.1.1.1", port: 11, endpoint: "1.1.1.1:11", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
makeServicePortName("ns1", "ep1", "p12", v1.ProtocolUDP): {
|
|
|
|
makeServicePortName("ns1", "ep1", "p12", v1.ProtocolUDP): {
|
|
|
|
{endpoint: "1.1.1.2:12", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
{ip: "1.1.1.2", port: 12, endpoint: "1.1.1.2:12", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
expectedDeletedUDPEndpoints: []ServiceEndpoint{},
|
|
|
|
expectedDeletedUDPEndpoints: []ServiceEndpoint{},
|
|
|
@@ -633,24 +633,24 @@ func TestUpdateEndpointsMap(t *testing.T) {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
previousEndpointsMap: map[ServicePortName][]*BaseEndpointInfo{
|
|
|
|
previousEndpointsMap: map[ServicePortName][]*BaseEndpointInfo{
|
|
|
|
makeServicePortName("ns1", "ep1", "p11", v1.ProtocolUDP): {
|
|
|
|
makeServicePortName("ns1", "ep1", "p11", v1.ProtocolUDP): {
|
|
|
|
{endpoint: "1.1.1.1:11", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
{ip: "1.1.1.1", port: 11, endpoint: "1.1.1.1:11", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
makeServicePortName("ns1", "ep1", "p12", v1.ProtocolUDP): {
|
|
|
|
makeServicePortName("ns1", "ep1", "p12", v1.ProtocolUDP): {
|
|
|
|
{endpoint: "1.1.1.1:12", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
{ip: "1.1.1.1", port: 12, endpoint: "1.1.1.1:12", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
makeServicePortName("ns1", "ep1", "p13", v1.ProtocolUDP): {
|
|
|
|
makeServicePortName("ns1", "ep1", "p13", v1.ProtocolUDP): {
|
|
|
|
{endpoint: "1.1.1.3:13", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
{ip: "1.1.1.3", port: 13, endpoint: "1.1.1.3:13", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
expectedResult: map[ServicePortName][]*BaseEndpointInfo{
|
|
|
|
expectedResult: map[ServicePortName][]*BaseEndpointInfo{
|
|
|
|
makeServicePortName("ns1", "ep1", "p11", v1.ProtocolUDP): {
|
|
|
|
makeServicePortName("ns1", "ep1", "p11", v1.ProtocolUDP): {
|
|
|
|
{endpoint: "1.1.1.1:11", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
{ip: "1.1.1.1", port: 11, endpoint: "1.1.1.1:11", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
makeServicePortName("ns1", "ep1", "p12", v1.ProtocolUDP): {
|
|
|
|
makeServicePortName("ns1", "ep1", "p12", v1.ProtocolUDP): {
|
|
|
|
{endpoint: "1.1.1.1:12", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
{ip: "1.1.1.1", port: 12, endpoint: "1.1.1.1:12", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
makeServicePortName("ns1", "ep1", "p13", v1.ProtocolUDP): {
|
|
|
|
makeServicePortName("ns1", "ep1", "p13", v1.ProtocolUDP): {
|
|
|
|
{endpoint: "1.1.1.3:13", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
{ip: "1.1.1.3", port: 13, endpoint: "1.1.1.3:13", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
expectedDeletedUDPEndpoints: []ServiceEndpoint{},
|
|
|
|
expectedDeletedUDPEndpoints: []ServiceEndpoint{},
|
|
|
@@ -673,54 +673,54 @@ func TestUpdateEndpointsMap(t *testing.T) {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
previousEndpointsMap: map[ServicePortName][]*BaseEndpointInfo{
|
|
|
|
previousEndpointsMap: map[ServicePortName][]*BaseEndpointInfo{
|
|
|
|
makeServicePortName("ns1", "ep1", "p11", v1.ProtocolUDP): {
|
|
|
|
makeServicePortName("ns1", "ep1", "p11", v1.ProtocolUDP): {
|
|
|
|
{endpoint: "1.1.1.1:11", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
{ip: "1.1.1.1", port: 11, endpoint: "1.1.1.1:11", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
{endpoint: "1.1.1.2:11", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
{ip: "1.1.1.2", port: 11, endpoint: "1.1.1.2:11", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
makeServicePortName("ns1", "ep1", "p12", v1.ProtocolUDP): {
|
|
|
|
makeServicePortName("ns1", "ep1", "p12", v1.ProtocolUDP): {
|
|
|
|
{endpoint: "1.1.1.1:12", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
{ip: "1.1.1.1", port: 12, endpoint: "1.1.1.1:12", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
{endpoint: "1.1.1.2:12", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
{ip: "1.1.1.2", port: 12, endpoint: "1.1.1.2:12", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
makeServicePortName("ns1", "ep1", "p13", v1.ProtocolUDP): {
|
|
|
|
makeServicePortName("ns1", "ep1", "p13", v1.ProtocolUDP): {
|
|
|
|
{endpoint: "1.1.1.3:13", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
{ip: "1.1.1.3", port: 13, endpoint: "1.1.1.3:13", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
{endpoint: "1.1.1.4:13", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
{ip: "1.1.1.4", port: 13, endpoint: "1.1.1.4:13", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
makeServicePortName("ns1", "ep1", "p14", v1.ProtocolUDP): {
|
|
|
|
makeServicePortName("ns1", "ep1", "p14", v1.ProtocolUDP): {
|
|
|
|
{endpoint: "1.1.1.3:14", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
{ip: "1.1.1.3", port: 14, endpoint: "1.1.1.3:14", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
{endpoint: "1.1.1.4:14", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
{ip: "1.1.1.4", port: 14, endpoint: "1.1.1.4:14", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
makeServicePortName("ns2", "ep2", "p21", v1.ProtocolUDP): {
|
|
|
|
makeServicePortName("ns2", "ep2", "p21", v1.ProtocolUDP): {
|
|
|
|
{endpoint: "2.2.2.1:21", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
{ip: "2.2.2.1", port: 21, endpoint: "2.2.2.1:21", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
{endpoint: "2.2.2.2:21", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
{ip: "2.2.2.2", port: 21, endpoint: "2.2.2.2:21", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
makeServicePortName("ns2", "ep2", "p22", v1.ProtocolUDP): {
|
|
|
|
makeServicePortName("ns2", "ep2", "p22", v1.ProtocolUDP): {
|
|
|
|
{endpoint: "2.2.2.1:22", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
{ip: "2.2.2.1", port: 22, endpoint: "2.2.2.1:22", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
{endpoint: "2.2.2.2:22", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
{ip: "2.2.2.2", port: 22, endpoint: "2.2.2.2:22", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
expectedResult: map[ServicePortName][]*BaseEndpointInfo{
|
|
|
|
expectedResult: map[ServicePortName][]*BaseEndpointInfo{
|
|
|
|
makeServicePortName("ns1", "ep1", "p11", v1.ProtocolUDP): {
|
|
|
|
makeServicePortName("ns1", "ep1", "p11", v1.ProtocolUDP): {
|
|
|
|
{endpoint: "1.1.1.1:11", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
{ip: "1.1.1.1", port: 11, endpoint: "1.1.1.1:11", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
{endpoint: "1.1.1.2:11", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
{ip: "1.1.1.2", port: 11, endpoint: "1.1.1.2:11", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
makeServicePortName("ns1", "ep1", "p12", v1.ProtocolUDP): {
|
|
|
|
makeServicePortName("ns1", "ep1", "p12", v1.ProtocolUDP): {
|
|
|
|
{endpoint: "1.1.1.1:12", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
{ip: "1.1.1.1", port: 12, endpoint: "1.1.1.1:12", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
{endpoint: "1.1.1.2:12", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
{ip: "1.1.1.2", port: 12, endpoint: "1.1.1.2:12", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
makeServicePortName("ns1", "ep1", "p13", v1.ProtocolUDP): {
|
|
|
|
makeServicePortName("ns1", "ep1", "p13", v1.ProtocolUDP): {
|
|
|
|
{endpoint: "1.1.1.3:13", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
{ip: "1.1.1.3", port: 13, endpoint: "1.1.1.3:13", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
{endpoint: "1.1.1.4:13", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
{ip: "1.1.1.4", port: 13, endpoint: "1.1.1.4:13", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
makeServicePortName("ns1", "ep1", "p14", v1.ProtocolUDP): {
|
|
|
|
makeServicePortName("ns1", "ep1", "p14", v1.ProtocolUDP): {
|
|
|
|
{endpoint: "1.1.1.3:14", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
{ip: "1.1.1.3", port: 14, endpoint: "1.1.1.3:14", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
{endpoint: "1.1.1.4:14", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
{ip: "1.1.1.4", port: 14, endpoint: "1.1.1.4:14", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
makeServicePortName("ns2", "ep2", "p21", v1.ProtocolUDP): {
|
|
|
|
makeServicePortName("ns2", "ep2", "p21", v1.ProtocolUDP): {
|
|
|
|
{endpoint: "2.2.2.1:21", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
{ip: "2.2.2.1", port: 21, endpoint: "2.2.2.1:21", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
{endpoint: "2.2.2.2:21", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
{ip: "2.2.2.2", port: 21, endpoint: "2.2.2.2:21", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
makeServicePortName("ns2", "ep2", "p22", v1.ProtocolUDP): {
|
|
|
|
makeServicePortName("ns2", "ep2", "p22", v1.ProtocolUDP): {
|
|
|
|
{endpoint: "2.2.2.1:22", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
{ip: "2.2.2.1", port: 22, endpoint: "2.2.2.1:22", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
{endpoint: "2.2.2.2:22", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
{ip: "2.2.2.2", port: 22, endpoint: "2.2.2.2:22", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
expectedDeletedUDPEndpoints: []ServiceEndpoint{},
|
|
|
|
expectedDeletedUDPEndpoints: []ServiceEndpoint{},
|
|
|
@@ -741,7 +741,7 @@ func TestUpdateEndpointsMap(t *testing.T) {
|
|
|
|
previousEndpointsMap: map[ServicePortName][]*BaseEndpointInfo{},
|
|
|
|
previousEndpointsMap: map[ServicePortName][]*BaseEndpointInfo{},
|
|
|
|
expectedResult: map[ServicePortName][]*BaseEndpointInfo{
|
|
|
|
expectedResult: map[ServicePortName][]*BaseEndpointInfo{
|
|
|
|
makeServicePortName("ns1", "ep1", "", v1.ProtocolUDP): {
|
|
|
|
makeServicePortName("ns1", "ep1", "", v1.ProtocolUDP): {
|
|
|
|
{endpoint: "1.1.1.1:11", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
{ip: "1.1.1.1", port: 11, endpoint: "1.1.1.1:11", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
expectedDeletedUDPEndpoints: []ServiceEndpoint{},
|
|
|
|
expectedDeletedUDPEndpoints: []ServiceEndpoint{},
|
|
|
@@ -762,7 +762,7 @@ func TestUpdateEndpointsMap(t *testing.T) {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
previousEndpointsMap: map[ServicePortName][]*BaseEndpointInfo{
|
|
|
|
previousEndpointsMap: map[ServicePortName][]*BaseEndpointInfo{
|
|
|
|
makeServicePortName("ns1", "ep1", "", v1.ProtocolUDP): {
|
|
|
|
makeServicePortName("ns1", "ep1", "", v1.ProtocolUDP): {
|
|
|
|
{endpoint: "1.1.1.1:11", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
{ip: "1.1.1.1", port: 11, endpoint: "1.1.1.1:11", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
expectedResult: map[ServicePortName][]*BaseEndpointInfo{},
|
|
|
|
expectedResult: map[ServicePortName][]*BaseEndpointInfo{},
|
|
|
@@ -783,17 +783,17 @@ func TestUpdateEndpointsMap(t *testing.T) {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
previousEndpointsMap: map[ServicePortName][]*BaseEndpointInfo{
|
|
|
|
previousEndpointsMap: map[ServicePortName][]*BaseEndpointInfo{
|
|
|
|
makeServicePortName("ns1", "ep1", "p11", v1.ProtocolUDP): {
|
|
|
|
makeServicePortName("ns1", "ep1", "p11", v1.ProtocolUDP): {
|
|
|
|
{endpoint: "1.1.1.1:11", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
{ip: "1.1.1.1", port: 11, endpoint: "1.1.1.1:11", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
expectedResult: map[ServicePortName][]*BaseEndpointInfo{
|
|
|
|
expectedResult: map[ServicePortName][]*BaseEndpointInfo{
|
|
|
|
makeServicePortName("ns1", "ep1", "p11", v1.ProtocolUDP): {
|
|
|
|
makeServicePortName("ns1", "ep1", "p11", v1.ProtocolUDP): {
|
|
|
|
{endpoint: "1.1.1.1:11", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
{ip: "1.1.1.1", port: 11, endpoint: "1.1.1.1:11", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
{endpoint: "1.1.1.2:11", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
{ip: "1.1.1.2", port: 11, endpoint: "1.1.1.2:11", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
makeServicePortName("ns1", "ep1", "p12", v1.ProtocolUDP): {
|
|
|
|
makeServicePortName("ns1", "ep1", "p12", v1.ProtocolUDP): {
|
|
|
|
{endpoint: "1.1.1.1:12", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
{ip: "1.1.1.1", port: 12, endpoint: "1.1.1.1:12", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
{endpoint: "1.1.1.2:12", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
{ip: "1.1.1.2", port: 12, endpoint: "1.1.1.2:12", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
expectedDeletedUDPEndpoints: []ServiceEndpoint{},
|
|
|
|
expectedDeletedUDPEndpoints: []ServiceEndpoint{},
|
|
|
@@ -814,17 +814,17 @@ func TestUpdateEndpointsMap(t *testing.T) {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
previousEndpointsMap: map[ServicePortName][]*BaseEndpointInfo{
|
|
|
|
previousEndpointsMap: map[ServicePortName][]*BaseEndpointInfo{
|
|
|
|
makeServicePortName("ns1", "ep1", "p11", v1.ProtocolUDP): {
|
|
|
|
makeServicePortName("ns1", "ep1", "p11", v1.ProtocolUDP): {
|
|
|
|
{endpoint: "1.1.1.1:11", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
{ip: "1.1.1.1", port: 11, endpoint: "1.1.1.1:11", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
{endpoint: "1.1.1.2:11", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
{ip: "1.1.1.2", port: 11, endpoint: "1.1.1.2:11", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
makeServicePortName("ns1", "ep1", "p12", v1.ProtocolUDP): {
|
|
|
|
makeServicePortName("ns1", "ep1", "p12", v1.ProtocolUDP): {
|
|
|
|
{endpoint: "1.1.1.1:12", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
{ip: "1.1.1.1", port: 12, endpoint: "1.1.1.1:12", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
{endpoint: "1.1.1.2:12", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
{ip: "1.1.1.2", port: 12, endpoint: "1.1.1.2:12", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
expectedResult: map[ServicePortName][]*BaseEndpointInfo{
|
|
|
|
expectedResult: map[ServicePortName][]*BaseEndpointInfo{
|
|
|
|
makeServicePortName("ns1", "ep1", "p11", v1.ProtocolUDP): {
|
|
|
|
makeServicePortName("ns1", "ep1", "p11", v1.ProtocolUDP): {
|
|
|
|
{endpoint: "1.1.1.1:11", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
{ip: "1.1.1.1", port: 11, endpoint: "1.1.1.1:11", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
expectedDeletedUDPEndpoints: []ServiceEndpoint{{
|
|
|
|
expectedDeletedUDPEndpoints: []ServiceEndpoint{{
|
|
|
@@ -852,15 +852,15 @@ func TestUpdateEndpointsMap(t *testing.T) {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
previousEndpointsMap: map[ServicePortName][]*BaseEndpointInfo{
|
|
|
|
previousEndpointsMap: map[ServicePortName][]*BaseEndpointInfo{
|
|
|
|
makeServicePortName("ns1", "ep1", "p11", v1.ProtocolUDP): {
|
|
|
|
makeServicePortName("ns1", "ep1", "p11", v1.ProtocolUDP): {
|
|
|
|
{endpoint: "1.1.1.1:11", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
{ip: "1.1.1.1", port: 11, endpoint: "1.1.1.1:11", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
expectedResult: map[ServicePortName][]*BaseEndpointInfo{
|
|
|
|
expectedResult: map[ServicePortName][]*BaseEndpointInfo{
|
|
|
|
makeServicePortName("ns1", "ep1", "p11", v1.ProtocolUDP): {
|
|
|
|
makeServicePortName("ns1", "ep1", "p11", v1.ProtocolUDP): {
|
|
|
|
{endpoint: "1.1.1.1:11", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
{ip: "1.1.1.1", port: 11, endpoint: "1.1.1.1:11", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
makeServicePortName("ns1", "ep1", "p12", v1.ProtocolUDP): {
|
|
|
|
makeServicePortName("ns1", "ep1", "p12", v1.ProtocolUDP): {
|
|
|
|
{endpoint: "1.1.1.2:12", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
{ip: "1.1.1.2", port: 12, endpoint: "1.1.1.2:12", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
expectedDeletedUDPEndpoints: []ServiceEndpoint{},
|
|
|
|
expectedDeletedUDPEndpoints: []ServiceEndpoint{},
|
|
|
@@ -883,15 +883,15 @@ func TestUpdateEndpointsMap(t *testing.T) {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
previousEndpointsMap: map[ServicePortName][]*BaseEndpointInfo{
|
|
|
|
previousEndpointsMap: map[ServicePortName][]*BaseEndpointInfo{
|
|
|
|
makeServicePortName("ns1", "ep1", "p11", v1.ProtocolUDP): {
|
|
|
|
makeServicePortName("ns1", "ep1", "p11", v1.ProtocolUDP): {
|
|
|
|
{endpoint: "1.1.1.1:11", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
{ip: "1.1.1.1", port: 11, endpoint: "1.1.1.1:11", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
makeServicePortName("ns1", "ep1", "p12", v1.ProtocolUDP): {
|
|
|
|
makeServicePortName("ns1", "ep1", "p12", v1.ProtocolUDP): {
|
|
|
|
{endpoint: "1.1.1.2:12", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
{ip: "1.1.1.2", port: 12, endpoint: "1.1.1.2:12", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
expectedResult: map[ServicePortName][]*BaseEndpointInfo{
|
|
|
|
expectedResult: map[ServicePortName][]*BaseEndpointInfo{
|
|
|
|
makeServicePortName("ns1", "ep1", "p11", v1.ProtocolUDP): {
|
|
|
|
makeServicePortName("ns1", "ep1", "p11", v1.ProtocolUDP): {
|
|
|
|
{endpoint: "1.1.1.1:11", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
{ip: "1.1.1.1", port: 11, endpoint: "1.1.1.1:11", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
expectedDeletedUDPEndpoints: []ServiceEndpoint{{
|
|
|
|
expectedDeletedUDPEndpoints: []ServiceEndpoint{{
|
|
|
@@ -911,12 +911,12 @@ func TestUpdateEndpointsMap(t *testing.T) {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
previousEndpointsMap: map[ServicePortName][]*BaseEndpointInfo{
|
|
|
|
previousEndpointsMap: map[ServicePortName][]*BaseEndpointInfo{
|
|
|
|
makeServicePortName("ns1", "ep1", "p11", v1.ProtocolUDP): {
|
|
|
|
makeServicePortName("ns1", "ep1", "p11", v1.ProtocolUDP): {
|
|
|
|
{endpoint: "1.1.1.1:11", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
{ip: "1.1.1.1", port: 11, endpoint: "1.1.1.1:11", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
expectedResult: map[ServicePortName][]*BaseEndpointInfo{
|
|
|
|
expectedResult: map[ServicePortName][]*BaseEndpointInfo{
|
|
|
|
makeServicePortName("ns1", "ep1", "p11-2", v1.ProtocolUDP): {
|
|
|
|
makeServicePortName("ns1", "ep1", "p11-2", v1.ProtocolUDP): {
|
|
|
|
{endpoint: "1.1.1.1:11", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
{ip: "1.1.1.1", port: 11, endpoint: "1.1.1.1:11", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
expectedDeletedUDPEndpoints: []ServiceEndpoint{{
|
|
|
|
expectedDeletedUDPEndpoints: []ServiceEndpoint{{
|
|
|
@@ -938,12 +938,12 @@ func TestUpdateEndpointsMap(t *testing.T) {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
previousEndpointsMap: map[ServicePortName][]*BaseEndpointInfo{
|
|
|
|
previousEndpointsMap: map[ServicePortName][]*BaseEndpointInfo{
|
|
|
|
makeServicePortName("ns1", "ep1", "p11", v1.ProtocolUDP): {
|
|
|
|
makeServicePortName("ns1", "ep1", "p11", v1.ProtocolUDP): {
|
|
|
|
{endpoint: "1.1.1.1:11", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
{ip: "1.1.1.1", port: 11, endpoint: "1.1.1.1:11", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
expectedResult: map[ServicePortName][]*BaseEndpointInfo{
|
|
|
|
expectedResult: map[ServicePortName][]*BaseEndpointInfo{
|
|
|
|
makeServicePortName("ns1", "ep1", "p11", v1.ProtocolUDP): {
|
|
|
|
makeServicePortName("ns1", "ep1", "p11", v1.ProtocolUDP): {
|
|
|
|
{endpoint: "1.1.1.1:22", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
{ip: "1.1.1.1", port: 22, endpoint: "1.1.1.1:22", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
expectedDeletedUDPEndpoints: []ServiceEndpoint{{
|
|
|
|
expectedDeletedUDPEndpoints: []ServiceEndpoint{{
|
|
|
@@ -983,39 +983,39 @@ func TestUpdateEndpointsMap(t *testing.T) {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
previousEndpointsMap: map[ServicePortName][]*BaseEndpointInfo{
|
|
|
|
previousEndpointsMap: map[ServicePortName][]*BaseEndpointInfo{
|
|
|
|
makeServicePortName("ns1", "ep1", "p11", v1.ProtocolUDP): {
|
|
|
|
makeServicePortName("ns1", "ep1", "p11", v1.ProtocolUDP): {
|
|
|
|
{endpoint: "1.1.1.1:11", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
{ip: "1.1.1.1", port: 11, endpoint: "1.1.1.1:11", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
makeServicePortName("ns2", "ep2", "p22", v1.ProtocolUDP): {
|
|
|
|
makeServicePortName("ns2", "ep2", "p22", v1.ProtocolUDP): {
|
|
|
|
{endpoint: "2.2.2.22:22", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
{ip: "2.2.2.22", port: 22, endpoint: "2.2.2.22:22", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
{endpoint: "2.2.2.2:22", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
{ip: "2.2.2.2", port: 22, endpoint: "2.2.2.2:22", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
makeServicePortName("ns2", "ep2", "p23", v1.ProtocolUDP): {
|
|
|
|
makeServicePortName("ns2", "ep2", "p23", v1.ProtocolUDP): {
|
|
|
|
{endpoint: "2.2.2.3:23", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
{ip: "2.2.2.3", port: 23, endpoint: "2.2.2.3:23", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
makeServicePortName("ns4", "ep4", "p44", v1.ProtocolUDP): {
|
|
|
|
makeServicePortName("ns4", "ep4", "p44", v1.ProtocolUDP): {
|
|
|
|
{endpoint: "4.4.4.4:44", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
{ip: "4.4.4.4", port: 44, endpoint: "4.4.4.4:44", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
{endpoint: "4.4.4.5:44", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
{ip: "4.4.4.5", port: 44, endpoint: "4.4.4.5:44", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
makeServicePortName("ns4", "ep4", "p45", v1.ProtocolUDP): {
|
|
|
|
makeServicePortName("ns4", "ep4", "p45", v1.ProtocolUDP): {
|
|
|
|
{endpoint: "4.4.4.6:45", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
{ip: "4.4.4.6", port: 45, endpoint: "4.4.4.6:45", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
expectedResult: map[ServicePortName][]*BaseEndpointInfo{
|
|
|
|
expectedResult: map[ServicePortName][]*BaseEndpointInfo{
|
|
|
|
makeServicePortName("ns1", "ep1", "p11", v1.ProtocolUDP): {
|
|
|
|
makeServicePortName("ns1", "ep1", "p11", v1.ProtocolUDP): {
|
|
|
|
{endpoint: "1.1.1.11:11", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
{ip: "1.1.1.11", port: 11, endpoint: "1.1.1.11:11", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
{endpoint: "1.1.1.1:11", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
{ip: "1.1.1.1", port: 11, endpoint: "1.1.1.1:11", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
makeServicePortName("ns1", "ep1", "p12", v1.ProtocolUDP): {
|
|
|
|
makeServicePortName("ns1", "ep1", "p12", v1.ProtocolUDP): {
|
|
|
|
{endpoint: "1.1.1.2:12", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
{ip: "1.1.1.2", port: 12, endpoint: "1.1.1.2:12", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
makeServicePortName("ns1", "ep1", "p122", v1.ProtocolUDP): {
|
|
|
|
makeServicePortName("ns1", "ep1", "p122", v1.ProtocolUDP): {
|
|
|
|
{endpoint: "1.1.1.2:122", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
{ip: "1.1.1.2", port: 122, endpoint: "1.1.1.2:122", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
makeServicePortName("ns3", "ep3", "p33", v1.ProtocolUDP): {
|
|
|
|
makeServicePortName("ns3", "ep3", "p33", v1.ProtocolUDP): {
|
|
|
|
{endpoint: "3.3.3.3:33", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
{ip: "3.3.3.3", port: 33, endpoint: "3.3.3.3:33", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
makeServicePortName("ns4", "ep4", "p44", v1.ProtocolUDP): {
|
|
|
|
makeServicePortName("ns4", "ep4", "p44", v1.ProtocolUDP): {
|
|
|
|
{endpoint: "4.4.4.4:44", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
{ip: "4.4.4.4", port: 44, endpoint: "4.4.4.4:44", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
expectedDeletedUDPEndpoints: []ServiceEndpoint{{
|
|
|
|
expectedDeletedUDPEndpoints: []ServiceEndpoint{{
|
|
|
@@ -1054,7 +1054,7 @@ func TestUpdateEndpointsMap(t *testing.T) {
|
|
|
|
previousEndpointsMap: map[ServicePortName][]*BaseEndpointInfo{},
|
|
|
|
previousEndpointsMap: map[ServicePortName][]*BaseEndpointInfo{},
|
|
|
|
expectedResult: map[ServicePortName][]*BaseEndpointInfo{
|
|
|
|
expectedResult: map[ServicePortName][]*BaseEndpointInfo{
|
|
|
|
makeServicePortName("ns1", "ep1", "", v1.ProtocolUDP): {
|
|
|
|
makeServicePortName("ns1", "ep1", "", v1.ProtocolUDP): {
|
|
|
|
{endpoint: "1.1.1.1:11", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
{ip: "1.1.1.1", port: 11, endpoint: "1.1.1.1:11", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
expectedDeletedUDPEndpoints: []ServiceEndpoint{},
|
|
|
|
expectedDeletedUDPEndpoints: []ServiceEndpoint{},
|
|
|
@@ -1073,12 +1073,12 @@ func TestUpdateEndpointsMap(t *testing.T) {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
previousEndpointsMap: map[ServicePortName][]*BaseEndpointInfo{
|
|
|
|
previousEndpointsMap: map[ServicePortName][]*BaseEndpointInfo{
|
|
|
|
makeServicePortName("ns1", "ep1", "", v1.ProtocolUDP): {
|
|
|
|
makeServicePortName("ns1", "ep1", "", v1.ProtocolUDP): {
|
|
|
|
{endpoint: "1.1.1.1:11", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
{ip: "1.1.1.1", port: 11, endpoint: "1.1.1.1:11", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
expectedResult: map[ServicePortName][]*BaseEndpointInfo{
|
|
|
|
expectedResult: map[ServicePortName][]*BaseEndpointInfo{
|
|
|
|
makeServicePortName("ns1", "ep1", "", v1.ProtocolUDP): {
|
|
|
|
makeServicePortName("ns1", "ep1", "", v1.ProtocolUDP): {
|
|
|
|
{endpoint: "1.1.1.1:11", isLocal: false, ready: false, serving: true, terminating: true},
|
|
|
|
{ip: "1.1.1.1", port: 11, endpoint: "1.1.1.1:11", isLocal: false, ready: false, serving: true, terminating: true},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
expectedDeletedUDPEndpoints: []ServiceEndpoint{},
|
|
|
|
expectedDeletedUDPEndpoints: []ServiceEndpoint{},
|
|
|
@@ -1095,7 +1095,7 @@ func TestUpdateEndpointsMap(t *testing.T) {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
previousEndpointsMap: map[ServicePortName][]*BaseEndpointInfo{
|
|
|
|
previousEndpointsMap: map[ServicePortName][]*BaseEndpointInfo{
|
|
|
|
makeServicePortName("ns1", "ep1", "", v1.ProtocolUDP): {
|
|
|
|
makeServicePortName("ns1", "ep1", "", v1.ProtocolUDP): {
|
|
|
|
{endpoint: "1.1.1.1:11", isLocal: false, ready: false, serving: true, terminating: true},
|
|
|
|
{ip: "1.1.1.1", port: 11, endpoint: "1.1.1.1:11", isLocal: false, ready: false, serving: true, terminating: true},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
expectedResult: map[ServicePortName][]*BaseEndpointInfo{},
|
|
|
|
expectedResult: map[ServicePortName][]*BaseEndpointInfo{},
|
|
|
@@ -1358,14 +1358,14 @@ func TestEndpointSliceUpdate(t *testing.T) {
|
|
|
|
expectedReturnVal: true,
|
|
|
|
expectedReturnVal: true,
|
|
|
|
expectedCurrentChange: map[ServicePortName][]*BaseEndpointInfo{
|
|
|
|
expectedCurrentChange: map[ServicePortName][]*BaseEndpointInfo{
|
|
|
|
makeServicePortName("ns1", "svc1", "port-0", v1.ProtocolTCP): {
|
|
|
|
makeServicePortName("ns1", "svc1", "port-0", v1.ProtocolTCP): {
|
|
|
|
&BaseEndpointInfo{endpoint: "10.0.1.1:80", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{ip: "10.0.1.1", port: 80, endpoint: "10.0.1.1:80", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{endpoint: "10.0.1.2:80", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{ip: "10.0.1.2", port: 80, endpoint: "10.0.1.2:80", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{endpoint: "10.0.1.3:80", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{ip: "10.0.1.3", port: 80, endpoint: "10.0.1.3:80", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
makeServicePortName("ns1", "svc1", "port-1", v1.ProtocolTCP): {
|
|
|
|
makeServicePortName("ns1", "svc1", "port-1", v1.ProtocolTCP): {
|
|
|
|
&BaseEndpointInfo{endpoint: "10.0.1.1:443", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{ip: "10.0.1.1", port: 443, endpoint: "10.0.1.1:443", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{endpoint: "10.0.1.2:443", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{ip: "10.0.1.2", port: 443, endpoint: "10.0.1.2:443", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{endpoint: "10.0.1.3:443", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{ip: "10.0.1.3", port: 443, endpoint: "10.0.1.3:443", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
expectedChangedEndpoints: sets.New[string]("ns1/svc1"),
|
|
|
|
expectedChangedEndpoints: sets.New[string]("ns1/svc1"),
|
|
|
@@ -1409,22 +1409,22 @@ func TestEndpointSliceUpdate(t *testing.T) {
|
|
|
|
expectedReturnVal: true,
|
|
|
|
expectedReturnVal: true,
|
|
|
|
expectedCurrentChange: map[ServicePortName][]*BaseEndpointInfo{
|
|
|
|
expectedCurrentChange: map[ServicePortName][]*BaseEndpointInfo{
|
|
|
|
makeServicePortName("ns1", "svc1", "port-0", v1.ProtocolTCP): {
|
|
|
|
makeServicePortName("ns1", "svc1", "port-0", v1.ProtocolTCP): {
|
|
|
|
&BaseEndpointInfo{endpoint: "10.0.1.1:80", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{ip: "10.0.1.1", port: 80, endpoint: "10.0.1.1:80", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{endpoint: "10.0.1.2:80", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{ip: "10.0.1.2", port: 80, endpoint: "10.0.1.2:80", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{endpoint: "10.0.1.3:80", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{ip: "10.0.1.3", port: 80, endpoint: "10.0.1.3:80", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{endpoint: "10.0.1.4:80", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{ip: "10.0.1.4", port: 80, endpoint: "10.0.1.4:80", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{endpoint: "10.0.1.5:80", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{ip: "10.0.1.5", port: 80, endpoint: "10.0.1.5:80", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{endpoint: "10.0.2.1:80", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{ip: "10.0.2.1", port: 80, endpoint: "10.0.2.1:80", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{endpoint: "10.0.2.2:80", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{ip: "10.0.2.2", port: 80, endpoint: "10.0.2.2:80", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
makeServicePortName("ns1", "svc1", "port-1", v1.ProtocolTCP): {
|
|
|
|
makeServicePortName("ns1", "svc1", "port-1", v1.ProtocolTCP): {
|
|
|
|
&BaseEndpointInfo{endpoint: "10.0.1.1:443", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{ip: "10.0.1.1", port: 443, endpoint: "10.0.1.1:443", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{endpoint: "10.0.1.2:443", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{ip: "10.0.1.2", port: 443, endpoint: "10.0.1.2:443", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{endpoint: "10.0.1.3:443", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{ip: "10.0.1.3", port: 443, endpoint: "10.0.1.3:443", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{endpoint: "10.0.1.4:443", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{ip: "10.0.1.4", port: 443, endpoint: "10.0.1.4:443", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{endpoint: "10.0.1.5:443", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{ip: "10.0.1.5", port: 443, endpoint: "10.0.1.5:443", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{endpoint: "10.0.2.1:443", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{ip: "10.0.2.1", port: 443, endpoint: "10.0.2.1:443", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{endpoint: "10.0.2.2:443", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{ip: "10.0.2.2", port: 443, endpoint: "10.0.2.2:443", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
expectedChangedEndpoints: sets.New[string]("ns1/svc1"),
|
|
|
|
expectedChangedEndpoints: sets.New[string]("ns1/svc1"),
|
|
|
@@ -1442,20 +1442,20 @@ func TestEndpointSliceUpdate(t *testing.T) {
|
|
|
|
expectedReturnVal: true,
|
|
|
|
expectedReturnVal: true,
|
|
|
|
expectedCurrentChange: map[ServicePortName][]*BaseEndpointInfo{
|
|
|
|
expectedCurrentChange: map[ServicePortName][]*BaseEndpointInfo{
|
|
|
|
makeServicePortName("ns1", "svc1", "port-0", v1.ProtocolTCP): {
|
|
|
|
makeServicePortName("ns1", "svc1", "port-0", v1.ProtocolTCP): {
|
|
|
|
&BaseEndpointInfo{endpoint: "10.0.1.1:80", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{ip: "10.0.1.1", port: 80, endpoint: "10.0.1.1:80", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{endpoint: "10.0.1.2:80", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{ip: "10.0.1.2", port: 80, endpoint: "10.0.1.2:80", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{endpoint: "10.0.1.3:80", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{ip: "10.0.1.3", port: 80, endpoint: "10.0.1.3:80", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{endpoint: "10.0.1.4:80", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{ip: "10.0.1.4", port: 80, endpoint: "10.0.1.4:80", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{endpoint: "10.0.1.5:80", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{ip: "10.0.1.5", port: 80, endpoint: "10.0.1.5:80", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{endpoint: "10.0.2.1:80", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{ip: "10.0.2.1", port: 80, endpoint: "10.0.2.1:80", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{endpoint: "10.0.2.2:80", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{ip: "10.0.2.2", port: 80, endpoint: "10.0.2.2:80", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
makeServicePortName("ns1", "svc1", "port-1", v1.ProtocolTCP): {
|
|
|
|
makeServicePortName("ns1", "svc1", "port-1", v1.ProtocolTCP): {
|
|
|
|
&BaseEndpointInfo{endpoint: "10.0.1.1:443", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{ip: "10.0.1.1", port: 443, endpoint: "10.0.1.1:443", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{endpoint: "10.0.1.2:443", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{ip: "10.0.1.2", port: 443, endpoint: "10.0.1.2:443", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{endpoint: "10.0.1.3:443", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{ip: "10.0.1.3", port: 443, endpoint: "10.0.1.3:443", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{endpoint: "10.0.2.1:443", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{ip: "10.0.2.1", port: 443, endpoint: "10.0.2.1:443", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{endpoint: "10.0.2.2:443", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{ip: "10.0.2.2", port: 443, endpoint: "10.0.2.2:443", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
expectedChangedEndpoints: sets.New[string]("ns1/svc1"),
|
|
|
|
expectedChangedEndpoints: sets.New[string]("ns1/svc1"),
|
|
|
@@ -1473,12 +1473,12 @@ func TestEndpointSliceUpdate(t *testing.T) {
|
|
|
|
expectedReturnVal: true,
|
|
|
|
expectedReturnVal: true,
|
|
|
|
expectedCurrentChange: map[ServicePortName][]*BaseEndpointInfo{
|
|
|
|
expectedCurrentChange: map[ServicePortName][]*BaseEndpointInfo{
|
|
|
|
makeServicePortName("ns1", "svc1", "port-0", v1.ProtocolTCP): {
|
|
|
|
makeServicePortName("ns1", "svc1", "port-0", v1.ProtocolTCP): {
|
|
|
|
&BaseEndpointInfo{endpoint: "10.0.2.1:80", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{ip: "10.0.2.1", port: 80, endpoint: "10.0.2.1:80", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{endpoint: "10.0.2.2:80", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{ip: "10.0.2.2", port: 80, endpoint: "10.0.2.2:80", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
makeServicePortName("ns1", "svc1", "port-1", v1.ProtocolTCP): {
|
|
|
|
makeServicePortName("ns1", "svc1", "port-1", v1.ProtocolTCP): {
|
|
|
|
&BaseEndpointInfo{endpoint: "10.0.2.1:443", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{ip: "10.0.2.1", port: 443, endpoint: "10.0.2.1:443", isLocal: false, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{endpoint: "10.0.2.2:443", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{ip: "10.0.2.2", port: 443, endpoint: "10.0.2.2:443", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
expectedChangedEndpoints: sets.New[string]("ns1/svc1"),
|
|
|
|
expectedChangedEndpoints: sets.New[string]("ns1/svc1"),
|
|
|
@@ -1509,14 +1509,14 @@ func TestEndpointSliceUpdate(t *testing.T) {
|
|
|
|
expectedReturnVal: true,
|
|
|
|
expectedReturnVal: true,
|
|
|
|
expectedCurrentChange: map[ServicePortName][]*BaseEndpointInfo{
|
|
|
|
expectedCurrentChange: map[ServicePortName][]*BaseEndpointInfo{
|
|
|
|
makeServicePortName("ns1", "svc1", "port-0", v1.ProtocolTCP): {
|
|
|
|
makeServicePortName("ns1", "svc1", "port-0", v1.ProtocolTCP): {
|
|
|
|
&BaseEndpointInfo{endpoint: "10.0.1.1:80", isLocal: true, ready: false, serving: false, terminating: false},
|
|
|
|
&BaseEndpointInfo{ip: "10.0.1.1", port: 80, endpoint: "10.0.1.1:80", isLocal: true, ready: false, serving: false, terminating: false},
|
|
|
|
&BaseEndpointInfo{endpoint: "10.0.1.2:80", isLocal: true, ready: false, serving: false, terminating: false},
|
|
|
|
&BaseEndpointInfo{ip: "10.0.1.2", port: 80, endpoint: "10.0.1.2:80", isLocal: true, ready: false, serving: false, terminating: false},
|
|
|
|
&BaseEndpointInfo{endpoint: "10.0.1.3:80", isLocal: true, ready: false, serving: false, terminating: false},
|
|
|
|
&BaseEndpointInfo{ip: "10.0.1.3", port: 80, endpoint: "10.0.1.3:80", isLocal: true, ready: false, serving: false, terminating: false},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
makeServicePortName("ns1", "svc1", "port-1", v1.ProtocolTCP): {
|
|
|
|
makeServicePortName("ns1", "svc1", "port-1", v1.ProtocolTCP): {
|
|
|
|
&BaseEndpointInfo{endpoint: "10.0.1.1:443", isLocal: true, ready: false, serving: false, terminating: false},
|
|
|
|
&BaseEndpointInfo{ip: "10.0.1.1", port: 443, endpoint: "10.0.1.1:443", isLocal: true, ready: false, serving: false, terminating: false},
|
|
|
|
&BaseEndpointInfo{endpoint: "10.0.1.2:443", isLocal: true, ready: false, serving: false, terminating: false},
|
|
|
|
&BaseEndpointInfo{ip: "10.0.1.2", port: 443, endpoint: "10.0.1.2:443", isLocal: true, ready: false, serving: false, terminating: false},
|
|
|
|
&BaseEndpointInfo{endpoint: "10.0.1.3:443", isLocal: true, ready: false, serving: false, terminating: false},
|
|
|
|
&BaseEndpointInfo{ip: "10.0.1.3", port: 443, endpoint: "10.0.1.3:443", isLocal: true, ready: false, serving: false, terminating: false},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
expectedChangedEndpoints: sets.New[string]("ns1/svc1"),
|
|
|
|
expectedChangedEndpoints: sets.New[string]("ns1/svc1"),
|
|
|
@@ -1533,12 +1533,12 @@ func TestEndpointSliceUpdate(t *testing.T) {
|
|
|
|
expectedReturnVal: true,
|
|
|
|
expectedReturnVal: true,
|
|
|
|
expectedCurrentChange: map[ServicePortName][]*BaseEndpointInfo{
|
|
|
|
expectedCurrentChange: map[ServicePortName][]*BaseEndpointInfo{
|
|
|
|
makeServicePortName("ns1", "svc1", "port-0", v1.ProtocolTCP): {
|
|
|
|
makeServicePortName("ns1", "svc1", "port-0", v1.ProtocolTCP): {
|
|
|
|
&BaseEndpointInfo{endpoint: "10.0.1.1:80", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{ip: "10.0.1.1", port: 80, endpoint: "10.0.1.1:80", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{endpoint: "10.0.1.2:80", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{ip: "10.0.1.2", port: 80, endpoint: "10.0.1.2:80", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
makeServicePortName("ns1", "svc1", "port-1", v1.ProtocolTCP): {
|
|
|
|
makeServicePortName("ns1", "svc1", "port-1", v1.ProtocolTCP): {
|
|
|
|
&BaseEndpointInfo{endpoint: "10.0.1.1:443", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{ip: "10.0.1.1", port: 443, endpoint: "10.0.1.1:443", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{endpoint: "10.0.1.2:443", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{ip: "10.0.1.2", port: 443, endpoint: "10.0.1.2:443", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
expectedChangedEndpoints: sets.New[string]("ns1/svc1"),
|
|
|
|
expectedChangedEndpoints: sets.New[string]("ns1/svc1"),
|
|
|
@@ -1556,18 +1556,18 @@ func TestEndpointSliceUpdate(t *testing.T) {
|
|
|
|
expectedReturnVal: true,
|
|
|
|
expectedReturnVal: true,
|
|
|
|
expectedCurrentChange: map[ServicePortName][]*BaseEndpointInfo{
|
|
|
|
expectedCurrentChange: map[ServicePortName][]*BaseEndpointInfo{
|
|
|
|
makeServicePortName("ns1", "svc1", "port-0", v1.ProtocolTCP): {
|
|
|
|
makeServicePortName("ns1", "svc1", "port-0", v1.ProtocolTCP): {
|
|
|
|
&BaseEndpointInfo{endpoint: "10.0.1.1:80", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{ip: "10.0.1.1", port: 80, endpoint: "10.0.1.1:80", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{endpoint: "10.0.1.2:80", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{ip: "10.0.1.2", port: 80, endpoint: "10.0.1.2:80", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{endpoint: "10.0.1.3:80", isLocal: true, ready: false, serving: false, terminating: false},
|
|
|
|
&BaseEndpointInfo{ip: "10.0.1.3", port: 80, endpoint: "10.0.1.3:80", isLocal: true, ready: false, serving: false, terminating: false},
|
|
|
|
&BaseEndpointInfo{endpoint: "10.0.2.1:80", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{ip: "10.0.2.1", port: 80, endpoint: "10.0.2.1:80", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{endpoint: "10.0.2.2:80", isLocal: true, ready: false, serving: false, terminating: false},
|
|
|
|
&BaseEndpointInfo{ip: "10.0.2.2", port: 80, endpoint: "10.0.2.2:80", isLocal: true, ready: false, serving: false, terminating: false},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
makeServicePortName("ns1", "svc1", "port-1", v1.ProtocolTCP): {
|
|
|
|
makeServicePortName("ns1", "svc1", "port-1", v1.ProtocolTCP): {
|
|
|
|
&BaseEndpointInfo{endpoint: "10.0.1.1:443", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{ip: "10.0.1.1", port: 443, endpoint: "10.0.1.1:443", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{endpoint: "10.0.1.2:443", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{ip: "10.0.1.2", port: 443, endpoint: "10.0.1.2:443", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{endpoint: "10.0.1.3:443", isLocal: true, ready: false, serving: false, terminating: false},
|
|
|
|
&BaseEndpointInfo{ip: "10.0.1.3", port: 443, endpoint: "10.0.1.3:443", isLocal: true, ready: false, serving: false, terminating: false},
|
|
|
|
&BaseEndpointInfo{endpoint: "10.0.2.1:443", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{ip: "10.0.2.1", port: 443, endpoint: "10.0.2.1:443", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{endpoint: "10.0.2.2:443", isLocal: true, ready: false, serving: false, terminating: false},
|
|
|
|
&BaseEndpointInfo{ip: "10.0.2.2", port: 443, endpoint: "10.0.2.2:443", isLocal: true, ready: false, serving: false, terminating: false},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
expectedChangedEndpoints: sets.New[string]("ns1/svc1"),
|
|
|
|
expectedChangedEndpoints: sets.New[string]("ns1/svc1"),
|
|
|
@@ -1585,18 +1585,18 @@ func TestEndpointSliceUpdate(t *testing.T) {
|
|
|
|
expectedReturnVal: true,
|
|
|
|
expectedReturnVal: true,
|
|
|
|
expectedCurrentChange: map[ServicePortName][]*BaseEndpointInfo{
|
|
|
|
expectedCurrentChange: map[ServicePortName][]*BaseEndpointInfo{
|
|
|
|
makeServicePortName("ns1", "svc1", "port-0", v1.ProtocolTCP): {
|
|
|
|
makeServicePortName("ns1", "svc1", "port-0", v1.ProtocolTCP): {
|
|
|
|
&BaseEndpointInfo{endpoint: "10.0.1.1:80", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{ip: "10.0.1.1", port: 80, endpoint: "10.0.1.1:80", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{endpoint: "10.0.1.2:80", isLocal: true, ready: false, serving: true, terminating: true},
|
|
|
|
&BaseEndpointInfo{ip: "10.0.1.2", port: 80, endpoint: "10.0.1.2:80", isLocal: true, ready: false, serving: true, terminating: true},
|
|
|
|
&BaseEndpointInfo{endpoint: "10.0.1.3:80", isLocal: true, ready: false, serving: false, terminating: false},
|
|
|
|
&BaseEndpointInfo{ip: "10.0.1.3", port: 80, endpoint: "10.0.1.3:80", isLocal: true, ready: false, serving: false, terminating: false},
|
|
|
|
&BaseEndpointInfo{endpoint: "10.0.2.1:80", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{ip: "10.0.2.1", port: 80, endpoint: "10.0.2.1:80", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{endpoint: "10.0.2.2:80", isLocal: true, ready: false, serving: false, terminating: true},
|
|
|
|
&BaseEndpointInfo{ip: "10.0.2.2", port: 80, endpoint: "10.0.2.2:80", isLocal: true, ready: false, serving: false, terminating: true},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
makeServicePortName("ns1", "svc1", "port-1", v1.ProtocolTCP): {
|
|
|
|
makeServicePortName("ns1", "svc1", "port-1", v1.ProtocolTCP): {
|
|
|
|
&BaseEndpointInfo{endpoint: "10.0.1.1:443", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{ip: "10.0.1.1", port: 443, endpoint: "10.0.1.1:443", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{endpoint: "10.0.1.2:443", isLocal: true, ready: false, serving: true, terminating: true},
|
|
|
|
&BaseEndpointInfo{ip: "10.0.1.2", port: 443, endpoint: "10.0.1.2:443", isLocal: true, ready: false, serving: true, terminating: true},
|
|
|
|
&BaseEndpointInfo{endpoint: "10.0.1.3:443", isLocal: true, ready: false, serving: false, terminating: false},
|
|
|
|
&BaseEndpointInfo{ip: "10.0.1.3", port: 443, endpoint: "10.0.1.3:443", isLocal: true, ready: false, serving: false, terminating: false},
|
|
|
|
&BaseEndpointInfo{endpoint: "10.0.2.1:443", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{ip: "10.0.2.1", port: 443, endpoint: "10.0.2.1:443", isLocal: true, ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{endpoint: "10.0.2.2:443", isLocal: true, ready: false, serving: false, terminating: true},
|
|
|
|
&BaseEndpointInfo{ip: "10.0.2.2", port: 443, endpoint: "10.0.2.2:443", isLocal: true, ready: false, serving: false, terminating: true},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
expectedChangedEndpoints: sets.New[string]("ns1/svc1"),
|
|
|
|
expectedChangedEndpoints: sets.New[string]("ns1/svc1"),
|
|
|
@@ -1655,9 +1655,9 @@ func TestCheckoutChanges(t *testing.T) {
|
|
|
|
previous: EndpointsMap{},
|
|
|
|
previous: EndpointsMap{},
|
|
|
|
current: EndpointsMap{
|
|
|
|
current: EndpointsMap{
|
|
|
|
svcPortName0: []Endpoint{
|
|
|
|
svcPortName0: []Endpoint{
|
|
|
|
&BaseEndpointInfo{endpoint: "10.0.1.1:80", ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{ip: "10.0.1.1", port: 80, endpoint: "10.0.1.1:80", ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{endpoint: "10.0.1.2:80", ready: false, serving: true, terminating: true},
|
|
|
|
&BaseEndpointInfo{ip: "10.0.1.2", port: 80, endpoint: "10.0.1.2:80", ready: false, serving: true, terminating: true},
|
|
|
|
&BaseEndpointInfo{endpoint: "10.0.1.3:80", ready: false, serving: false, terminating: false},
|
|
|
|
&BaseEndpointInfo{ip: "10.0.1.3", port: 80, endpoint: "10.0.1.3:80", ready: false, serving: false, terminating: false},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}},
|
|
|
|
}},
|
|
|
@@ -1671,21 +1671,21 @@ func TestCheckoutChanges(t *testing.T) {
|
|
|
|
expectedChanges: []*endpointsChange{{
|
|
|
|
expectedChanges: []*endpointsChange{{
|
|
|
|
previous: EndpointsMap{
|
|
|
|
previous: EndpointsMap{
|
|
|
|
svcPortName0: []Endpoint{
|
|
|
|
svcPortName0: []Endpoint{
|
|
|
|
&BaseEndpointInfo{endpoint: "10.0.1.1:80", ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{ip: "10.0.1.1", port: 80, endpoint: "10.0.1.1:80", ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{endpoint: "10.0.1.2:80", ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{ip: "10.0.1.2", port: 80, endpoint: "10.0.1.2:80", ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{endpoint: "10.0.1.3:80", ready: false, serving: false, terminating: false},
|
|
|
|
&BaseEndpointInfo{ip: "10.0.1.3", port: 80, endpoint: "10.0.1.3:80", ready: false, serving: false, terminating: false},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
svcPortName1: []Endpoint{
|
|
|
|
svcPortName1: []Endpoint{
|
|
|
|
&BaseEndpointInfo{endpoint: "10.0.1.1:443", ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{ip: "10.0.1.1", port: 443, endpoint: "10.0.1.1:443", ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{endpoint: "10.0.1.2:443", ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{ip: "10.0.1.2", port: 443, endpoint: "10.0.1.2:443", ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{endpoint: "10.0.1.3:443", ready: false, serving: false, terminating: false},
|
|
|
|
&BaseEndpointInfo{ip: "10.0.1.3", port: 443, endpoint: "10.0.1.3:443", ready: false, serving: false, terminating: false},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
current: EndpointsMap{
|
|
|
|
current: EndpointsMap{
|
|
|
|
svcPortName0: []Endpoint{
|
|
|
|
svcPortName0: []Endpoint{
|
|
|
|
&BaseEndpointInfo{endpoint: "10.0.1.1:80", ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{ip: "10.0.1.1", port: 80, endpoint: "10.0.1.1:80", ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{endpoint: "10.0.1.2:80", ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{ip: "10.0.1.2", port: 80, endpoint: "10.0.1.2:80", ready: true, serving: true, terminating: false},
|
|
|
|
&BaseEndpointInfo{endpoint: "10.0.1.3:80", ready: false, serving: false, terminating: false},
|
|
|
|
&BaseEndpointInfo{ip: "10.0.1.3", port: 80, endpoint: "10.0.1.3:80", ready: false, serving: false, terminating: false},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}},
|
|
|
|
}},
|
|
|
|