@@ -1037,7 +1037,6 @@ func TestUpdateEndpointsMap(t *testing.T) {
1037
1037
for tci , tc := range testCases {
1038
1038
t .Run (tc .name , func (t * testing.T ) {
1039
1039
fp := newFakeProxier (v1 .IPv4Protocol , time.Time {})
1040
- fp .hostname = testHostname
1041
1040
1042
1041
// First check that after adding all previous versions of endpoints,
1043
1042
// the fp.previousEndpointsMap is as we expect.
@@ -1245,7 +1244,7 @@ func TestEndpointSliceUpdate(t *testing.T) {
1245
1244
// test starting from an empty state
1246
1245
"add a simple slice that doesn't already exist" : {
1247
1246
startingSlices : []* discovery.EndpointSlice {},
1248
- endpointsChangeTracker : NewEndpointsChangeTracker ("host1" , nil , v1 .IPv4Protocol , nil , nil ),
1247
+ endpointsChangeTracker : NewEndpointsChangeTracker (v1 .IPv4Protocol , "host1" , nil , nil ),
1249
1248
namespacedName : types.NamespacedName {Name : "svc1" , Namespace : "ns1" },
1250
1249
paramEndpointSlice : generateEndpointSlice ("svc1" , "ns1" , 1 , 3 , 999 , 999 , []string {"host1" , "host2" }, []* int32 {ptr.To [int32 ](80 ), ptr.To [int32 ](443 )}),
1251
1250
paramRemoveSlice : false ,
@@ -1268,7 +1267,7 @@ func TestEndpointSliceUpdate(t *testing.T) {
1268
1267
startingSlices : []* discovery.EndpointSlice {
1269
1268
generateEndpointSlice ("svc1" , "ns1" , 1 , 3 , 999 , 999 , []string {"host1" , "host2" }, []* int32 {ptr.To [int32 ](80 ), ptr.To [int32 ](443 )}),
1270
1269
},
1271
- endpointsChangeTracker : NewEndpointsChangeTracker ("host1" , nil , v1 .IPv4Protocol , nil , nil ),
1270
+ endpointsChangeTracker : NewEndpointsChangeTracker (v1 .IPv4Protocol , "host1" , nil , nil ),
1272
1271
namespacedName : types.NamespacedName {Name : "svc1" , Namespace : "ns1" },
1273
1272
paramEndpointSlice : generateEndpointSlice ("svc1" , "ns1" , 1 , 3 , 999 , 999 , []string {"host1" , "host2" }, []* int32 {ptr.To [int32 ](80 ), ptr.To [int32 ](443 )}),
1274
1273
paramRemoveSlice : false ,
@@ -1280,7 +1279,7 @@ func TestEndpointSliceUpdate(t *testing.T) {
1280
1279
startingSlices : []* discovery.EndpointSlice {
1281
1280
generateEndpointSlice ("svc1" , "ns1" , 1 , 3 , 999 , 999 , []string {"host1" , "host2" }, []* int32 {ptr.To [int32 ](80 ), ptr.To [int32 ](443 )}),
1282
1281
},
1283
- endpointsChangeTracker : NewEndpointsChangeTracker ("host1" , nil , v1 .IPv4Protocol , nil , nil ),
1282
+ endpointsChangeTracker : NewEndpointsChangeTracker (v1 .IPv4Protocol , "host1" , nil , nil ),
1284
1283
namespacedName : types.NamespacedName {Name : "svc1" , Namespace : "ns1" },
1285
1284
paramEndpointSlice : fqdnSlice ,
1286
1285
paramRemoveSlice : false ,
@@ -1293,7 +1292,7 @@ func TestEndpointSliceUpdate(t *testing.T) {
1293
1292
generateEndpointSlice ("svc1" , "ns1" , 1 , 3 , 999 , 999 , []string {"host1" , "host2" }, []* int32 {ptr.To [int32 ](80 ), ptr.To [int32 ](443 )}),
1294
1293
generateEndpointSlice ("svc1" , "ns1" , 2 , 2 , 999 , 999 , []string {"host1" , "host2" }, []* int32 {ptr.To [int32 ](80 ), ptr.To [int32 ](443 )}),
1295
1294
},
1296
- endpointsChangeTracker : NewEndpointsChangeTracker ("host1" , nil , v1 .IPv4Protocol , nil , nil ),
1295
+ endpointsChangeTracker : NewEndpointsChangeTracker (v1 .IPv4Protocol , "host1" , nil , nil ),
1297
1296
namespacedName : types.NamespacedName {Name : "svc1" , Namespace : "ns1" },
1298
1297
paramEndpointSlice : generateEndpointSlice ("svc1" , "ns1" , 1 , 5 , 999 , 999 , []string {"host1" }, []* int32 {ptr.To [int32 ](80 ), ptr.To [int32 ](443 )}),
1299
1298
paramRemoveSlice : false ,
@@ -1325,7 +1324,7 @@ func TestEndpointSliceUpdate(t *testing.T) {
1325
1324
generateEndpointSlice ("svc1" , "ns1" , 1 , 3 , 999 , 999 , []string {"host1" , "host2" }, []* int32 {ptr.To [int32 ](80 ), ptr.To [int32 ](443 )}),
1326
1325
generateEndpointSlice ("svc1" , "ns1" , 2 , 2 , 999 , 999 , []string {"host1" , "host2" }, []* int32 {ptr.To [int32 ](80 ), ptr.To [int32 ](443 )}),
1327
1326
},
1328
- endpointsChangeTracker : NewEndpointsChangeTracker ("host1" , nil , v1 .IPv4Protocol , nil , nil ),
1327
+ endpointsChangeTracker : NewEndpointsChangeTracker (v1 .IPv4Protocol , "host1" , nil , nil ),
1329
1328
namespacedName : types.NamespacedName {Name : "svc1" , Namespace : "ns1" },
1330
1329
paramEndpointSlice : generateEndpointSliceWithOffset ("svc1" , "ns1" , 3 , 1 , 5 , 999 , 999 , []string {"host1" }, []* int32 {ptr.To [int32 ](80 )}),
1331
1330
paramRemoveSlice : false ,
@@ -1355,7 +1354,7 @@ func TestEndpointSliceUpdate(t *testing.T) {
1355
1354
generateEndpointSlice ("svc1" , "ns1" , 1 , 3 , 999 , 999 , []string {"host1" , "host2" }, []* int32 {ptr.To [int32 ](80 ), ptr.To [int32 ](443 )}),
1356
1355
generateEndpointSlice ("svc1" , "ns1" , 2 , 2 , 999 , 999 , []string {"host1" , "host2" }, []* int32 {ptr.To [int32 ](80 ), ptr.To [int32 ](443 )}),
1357
1356
},
1358
- endpointsChangeTracker : NewEndpointsChangeTracker ("host1" , nil , v1 .IPv4Protocol , nil , nil ),
1357
+ endpointsChangeTracker : NewEndpointsChangeTracker (v1 .IPv4Protocol , "host1" , nil , nil ),
1359
1358
namespacedName : types.NamespacedName {Name : "svc1" , Namespace : "ns1" },
1360
1359
paramEndpointSlice : generateEndpointSlice ("svc1" , "ns1" , 1 , 5 , 999 , 999 , []string {"host1" }, []* int32 {ptr.To [int32 ](80 ), ptr.To [int32 ](443 )}),
1361
1360
paramRemoveSlice : true ,
@@ -1377,7 +1376,7 @@ func TestEndpointSliceUpdate(t *testing.T) {
1377
1376
generateEndpointSlice ("svc1" , "ns1" , 1 , 5 , 999 , 999 , []string {"host1" }, []* int32 {ptr.To [int32 ](80 ), ptr.To [int32 ](443 )}),
1378
1377
generateEndpointSlice ("svc1" , "ns1" , 2 , 2 , 999 , 999 , []string {"host1" }, []* int32 {ptr.To [int32 ](80 ), ptr.To [int32 ](443 )}),
1379
1378
},
1380
- endpointsChangeTracker : NewEndpointsChangeTracker ("host1" , nil , v1 .IPv4Protocol , nil , nil ),
1379
+ endpointsChangeTracker : NewEndpointsChangeTracker (v1 .IPv4Protocol , "host1" , nil , nil ),
1381
1380
namespacedName : types.NamespacedName {Name : "svc1" , Namespace : "ns1" },
1382
1381
paramEndpointSlice : generateEndpointSlice ("svc1" , "ns1" , 3 , 5 , 999 , 999 , []string {"host1" }, []* int32 {ptr.To [int32 ](80 ), ptr.To [int32 ](443 )}),
1383
1382
paramRemoveSlice : true ,
@@ -1389,7 +1388,7 @@ func TestEndpointSliceUpdate(t *testing.T) {
1389
1388
startingSlices : []* discovery.EndpointSlice {
1390
1389
generateEndpointSlice ("svc1" , "ns1" , 1 , 3 , 999 , 999 , []string {"host1" , "host2" }, []* int32 {ptr.To [int32 ](80 ), ptr.To [int32 ](443 )}),
1391
1390
},
1392
- endpointsChangeTracker : NewEndpointsChangeTracker ("host1" , nil , v1 .IPv4Protocol , nil , nil ),
1391
+ endpointsChangeTracker : NewEndpointsChangeTracker (v1 .IPv4Protocol , "host1" , nil , nil ),
1393
1392
namespacedName : types.NamespacedName {Name : "svc1" , Namespace : "ns1" },
1394
1393
paramEndpointSlice : generateEndpointSlice ("svc1" , "ns1" , 1 , 3 , 1 , 999 , []string {"host1" }, []* int32 {ptr.To [int32 ](80 ), ptr.To [int32 ](443 )}),
1395
1394
paramRemoveSlice : false ,
@@ -1412,7 +1411,7 @@ func TestEndpointSliceUpdate(t *testing.T) {
1412
1411
startingSlices : []* discovery.EndpointSlice {
1413
1412
generateEndpointSlice ("svc1" , "ns1" , 1 , 2 , 1 , 999 , []string {"host1" , "host2" }, []* int32 {ptr.To [int32 ](80 ), ptr.To [int32 ](443 )}),
1414
1413
},
1415
- endpointsChangeTracker : NewEndpointsChangeTracker ("host1" , nil , v1 .IPv4Protocol , nil , nil ),
1414
+ endpointsChangeTracker : NewEndpointsChangeTracker (v1 .IPv4Protocol , "host1" , nil , nil ),
1416
1415
namespacedName : types.NamespacedName {Name : "svc1" , Namespace : "ns1" },
1417
1416
paramEndpointSlice : generateEndpointSlice ("svc1" , "ns1" , 1 , 2 , 999 , 999 , []string {"host1" }, []* int32 {ptr.To [int32 ](80 ), ptr.To [int32 ](443 )}),
1418
1417
paramRemoveSlice : false ,
@@ -1434,7 +1433,7 @@ func TestEndpointSliceUpdate(t *testing.T) {
1434
1433
generateEndpointSlice ("svc1" , "ns1" , 1 , 3 , 2 , 999 , []string {"host1" }, []* int32 {ptr.To [int32 ](80 ), ptr.To [int32 ](443 )}),
1435
1434
generateEndpointSlice ("svc1" , "ns1" , 2 , 2 , 2 , 999 , []string {"host1" }, []* int32 {ptr.To [int32 ](80 ), ptr.To [int32 ](443 )}),
1436
1435
},
1437
- endpointsChangeTracker : NewEndpointsChangeTracker ("host1" , nil , v1 .IPv4Protocol , nil , nil ),
1436
+ endpointsChangeTracker : NewEndpointsChangeTracker (v1 .IPv4Protocol , "host1" , nil , nil ),
1438
1437
namespacedName : types.NamespacedName {Name : "svc1" , Namespace : "ns1" },
1439
1438
paramEndpointSlice : generateEndpointSlice ("svc1" , "ns1" , 1 , 3 , 3 , 999 , []string {"host1" }, []* int32 {ptr.To [int32 ](80 ), ptr.To [int32 ](443 )}),
1440
1439
paramRemoveSlice : false ,
@@ -1462,7 +1461,7 @@ func TestEndpointSliceUpdate(t *testing.T) {
1462
1461
generateEndpointSlice ("svc1" , "ns1" , 1 , 3 , 2 , 2 , []string {"host1" }, []* int32 {ptr.To [int32 ](80 ), ptr.To [int32 ](443 )}),
1463
1462
generateEndpointSlice ("svc1" , "ns1" , 2 , 2 , 2 , 2 , []string {"host1" }, []* int32 {ptr.To [int32 ](80 ), ptr.To [int32 ](443 )}),
1464
1463
},
1465
- endpointsChangeTracker : NewEndpointsChangeTracker ("host1" , nil , v1 .IPv4Protocol , nil , nil ),
1464
+ endpointsChangeTracker : NewEndpointsChangeTracker (v1 .IPv4Protocol , "host1" , nil , nil ),
1466
1465
namespacedName : types.NamespacedName {Name : "svc1" , Namespace : "ns1" },
1467
1466
paramEndpointSlice : generateEndpointSlice ("svc1" , "ns1" , 1 , 3 , 3 , 2 , []string {"host1" }, []* int32 {ptr.To [int32 ](80 ), ptr.To [int32 ](443 )}),
1468
1467
paramRemoveSlice : false ,
@@ -1522,13 +1521,13 @@ func TestCheckoutChanges(t *testing.T) {
1522
1521
pendingSlices []* discovery.EndpointSlice
1523
1522
}{
1524
1523
"empty slices" : {
1525
- endpointsChangeTracker : NewEndpointsChangeTracker ("" , nil , v1 .IPv4Protocol , nil , nil ),
1524
+ endpointsChangeTracker : NewEndpointsChangeTracker (v1 .IPv4Protocol , "" , nil , nil ),
1526
1525
expectedChanges : []* endpointsChange {},
1527
1526
appliedSlices : []* discovery.EndpointSlice {},
1528
1527
pendingSlices : []* discovery.EndpointSlice {},
1529
1528
},
1530
1529
"adding initial slice" : {
1531
- endpointsChangeTracker : NewEndpointsChangeTracker ("" , nil , v1 .IPv4Protocol , nil , nil ),
1530
+ endpointsChangeTracker : NewEndpointsChangeTracker (v1 .IPv4Protocol , "" , nil , nil ),
1532
1531
expectedChanges : []* endpointsChange {{
1533
1532
previous : EndpointsMap {},
1534
1533
current : EndpointsMap {
@@ -1545,7 +1544,7 @@ func TestCheckoutChanges(t *testing.T) {
1545
1544
},
1546
1545
},
1547
1546
"removing port in update" : {
1548
- endpointsChangeTracker : NewEndpointsChangeTracker ("" , nil , v1 .IPv4Protocol , nil , nil ),
1547
+ endpointsChangeTracker : NewEndpointsChangeTracker (v1 .IPv4Protocol , "" , nil , nil ),
1549
1548
expectedChanges : []* endpointsChange {{
1550
1549
previous : EndpointsMap {
1551
1550
svcPortName0 : []Endpoint {
0 commit comments