@@ -1244,7 +1244,7 @@ func TestEndpointSliceUpdate(t *testing.T) {
1244
1244
// test starting from an empty state
1245
1245
"add a simple slice that doesn't already exist" : {
1246
1246
startingSlices : []* discovery.EndpointSlice {},
1247
- endpointsChangeTracker : NewEndpointsChangeTracker ("host1" , nil , v1 .IPv4Protocol , nil , nil ),
1247
+ endpointsChangeTracker : NewEndpointsChangeTracker (v1 .IPv4Protocol , "host1" , nil , nil ),
1248
1248
namespacedName : types.NamespacedName {Name : "svc1" , Namespace : "ns1" },
1249
1249
paramEndpointSlice : generateEndpointSlice ("svc1" , "ns1" , 1 , 3 , 999 , 999 , []string {"host1" , "host2" }, []* int32 {ptr.To [int32 ](80 ), ptr.To [int32 ](443 )}),
1250
1250
paramRemoveSlice : false ,
@@ -1267,7 +1267,7 @@ func TestEndpointSliceUpdate(t *testing.T) {
1267
1267
startingSlices : []* discovery.EndpointSlice {
1268
1268
generateEndpointSlice ("svc1" , "ns1" , 1 , 3 , 999 , 999 , []string {"host1" , "host2" }, []* int32 {ptr.To [int32 ](80 ), ptr.To [int32 ](443 )}),
1269
1269
},
1270
- endpointsChangeTracker : NewEndpointsChangeTracker ("host1" , nil , v1 .IPv4Protocol , nil , nil ),
1270
+ endpointsChangeTracker : NewEndpointsChangeTracker (v1 .IPv4Protocol , "host1" , nil , nil ),
1271
1271
namespacedName : types.NamespacedName {Name : "svc1" , Namespace : "ns1" },
1272
1272
paramEndpointSlice : generateEndpointSlice ("svc1" , "ns1" , 1 , 3 , 999 , 999 , []string {"host1" , "host2" }, []* int32 {ptr.To [int32 ](80 ), ptr.To [int32 ](443 )}),
1273
1273
paramRemoveSlice : false ,
@@ -1279,7 +1279,7 @@ func TestEndpointSliceUpdate(t *testing.T) {
1279
1279
startingSlices : []* discovery.EndpointSlice {
1280
1280
generateEndpointSlice ("svc1" , "ns1" , 1 , 3 , 999 , 999 , []string {"host1" , "host2" }, []* int32 {ptr.To [int32 ](80 ), ptr.To [int32 ](443 )}),
1281
1281
},
1282
- endpointsChangeTracker : NewEndpointsChangeTracker ("host1" , nil , v1 .IPv4Protocol , nil , nil ),
1282
+ endpointsChangeTracker : NewEndpointsChangeTracker (v1 .IPv4Protocol , "host1" , nil , nil ),
1283
1283
namespacedName : types.NamespacedName {Name : "svc1" , Namespace : "ns1" },
1284
1284
paramEndpointSlice : fqdnSlice ,
1285
1285
paramRemoveSlice : false ,
@@ -1292,7 +1292,7 @@ func TestEndpointSliceUpdate(t *testing.T) {
1292
1292
generateEndpointSlice ("svc1" , "ns1" , 1 , 3 , 999 , 999 , []string {"host1" , "host2" }, []* int32 {ptr.To [int32 ](80 ), ptr.To [int32 ](443 )}),
1293
1293
generateEndpointSlice ("svc1" , "ns1" , 2 , 2 , 999 , 999 , []string {"host1" , "host2" }, []* int32 {ptr.To [int32 ](80 ), ptr.To [int32 ](443 )}),
1294
1294
},
1295
- endpointsChangeTracker : NewEndpointsChangeTracker ("host1" , nil , v1 .IPv4Protocol , nil , nil ),
1295
+ endpointsChangeTracker : NewEndpointsChangeTracker (v1 .IPv4Protocol , "host1" , nil , nil ),
1296
1296
namespacedName : types.NamespacedName {Name : "svc1" , Namespace : "ns1" },
1297
1297
paramEndpointSlice : generateEndpointSlice ("svc1" , "ns1" , 1 , 5 , 999 , 999 , []string {"host1" }, []* int32 {ptr.To [int32 ](80 ), ptr.To [int32 ](443 )}),
1298
1298
paramRemoveSlice : false ,
@@ -1324,7 +1324,7 @@ func TestEndpointSliceUpdate(t *testing.T) {
1324
1324
generateEndpointSlice ("svc1" , "ns1" , 1 , 3 , 999 , 999 , []string {"host1" , "host2" }, []* int32 {ptr.To [int32 ](80 ), ptr.To [int32 ](443 )}),
1325
1325
generateEndpointSlice ("svc1" , "ns1" , 2 , 2 , 999 , 999 , []string {"host1" , "host2" }, []* int32 {ptr.To [int32 ](80 ), ptr.To [int32 ](443 )}),
1326
1326
},
1327
- endpointsChangeTracker : NewEndpointsChangeTracker ("host1" , nil , v1 .IPv4Protocol , nil , nil ),
1327
+ endpointsChangeTracker : NewEndpointsChangeTracker (v1 .IPv4Protocol , "host1" , nil , nil ),
1328
1328
namespacedName : types.NamespacedName {Name : "svc1" , Namespace : "ns1" },
1329
1329
paramEndpointSlice : generateEndpointSliceWithOffset ("svc1" , "ns1" , 3 , 1 , 5 , 999 , 999 , []string {"host1" }, []* int32 {ptr.To [int32 ](80 )}),
1330
1330
paramRemoveSlice : false ,
@@ -1354,7 +1354,7 @@ func TestEndpointSliceUpdate(t *testing.T) {
1354
1354
generateEndpointSlice ("svc1" , "ns1" , 1 , 3 , 999 , 999 , []string {"host1" , "host2" }, []* int32 {ptr.To [int32 ](80 ), ptr.To [int32 ](443 )}),
1355
1355
generateEndpointSlice ("svc1" , "ns1" , 2 , 2 , 999 , 999 , []string {"host1" , "host2" }, []* int32 {ptr.To [int32 ](80 ), ptr.To [int32 ](443 )}),
1356
1356
},
1357
- endpointsChangeTracker : NewEndpointsChangeTracker ("host1" , nil , v1 .IPv4Protocol , nil , nil ),
1357
+ endpointsChangeTracker : NewEndpointsChangeTracker (v1 .IPv4Protocol , "host1" , nil , nil ),
1358
1358
namespacedName : types.NamespacedName {Name : "svc1" , Namespace : "ns1" },
1359
1359
paramEndpointSlice : generateEndpointSlice ("svc1" , "ns1" , 1 , 5 , 999 , 999 , []string {"host1" }, []* int32 {ptr.To [int32 ](80 ), ptr.To [int32 ](443 )}),
1360
1360
paramRemoveSlice : true ,
@@ -1376,7 +1376,7 @@ func TestEndpointSliceUpdate(t *testing.T) {
1376
1376
generateEndpointSlice ("svc1" , "ns1" , 1 , 5 , 999 , 999 , []string {"host1" }, []* int32 {ptr.To [int32 ](80 ), ptr.To [int32 ](443 )}),
1377
1377
generateEndpointSlice ("svc1" , "ns1" , 2 , 2 , 999 , 999 , []string {"host1" }, []* int32 {ptr.To [int32 ](80 ), ptr.To [int32 ](443 )}),
1378
1378
},
1379
- endpointsChangeTracker : NewEndpointsChangeTracker ("host1" , nil , v1 .IPv4Protocol , nil , nil ),
1379
+ endpointsChangeTracker : NewEndpointsChangeTracker (v1 .IPv4Protocol , "host1" , nil , nil ),
1380
1380
namespacedName : types.NamespacedName {Name : "svc1" , Namespace : "ns1" },
1381
1381
paramEndpointSlice : generateEndpointSlice ("svc1" , "ns1" , 3 , 5 , 999 , 999 , []string {"host1" }, []* int32 {ptr.To [int32 ](80 ), ptr.To [int32 ](443 )}),
1382
1382
paramRemoveSlice : true ,
@@ -1388,7 +1388,7 @@ func TestEndpointSliceUpdate(t *testing.T) {
1388
1388
startingSlices : []* discovery.EndpointSlice {
1389
1389
generateEndpointSlice ("svc1" , "ns1" , 1 , 3 , 999 , 999 , []string {"host1" , "host2" }, []* int32 {ptr.To [int32 ](80 ), ptr.To [int32 ](443 )}),
1390
1390
},
1391
- endpointsChangeTracker : NewEndpointsChangeTracker ("host1" , nil , v1 .IPv4Protocol , nil , nil ),
1391
+ endpointsChangeTracker : NewEndpointsChangeTracker (v1 .IPv4Protocol , "host1" , nil , nil ),
1392
1392
namespacedName : types.NamespacedName {Name : "svc1" , Namespace : "ns1" },
1393
1393
paramEndpointSlice : generateEndpointSlice ("svc1" , "ns1" , 1 , 3 , 1 , 999 , []string {"host1" }, []* int32 {ptr.To [int32 ](80 ), ptr.To [int32 ](443 )}),
1394
1394
paramRemoveSlice : false ,
@@ -1411,7 +1411,7 @@ func TestEndpointSliceUpdate(t *testing.T) {
1411
1411
startingSlices : []* discovery.EndpointSlice {
1412
1412
generateEndpointSlice ("svc1" , "ns1" , 1 , 2 , 1 , 999 , []string {"host1" , "host2" }, []* int32 {ptr.To [int32 ](80 ), ptr.To [int32 ](443 )}),
1413
1413
},
1414
- endpointsChangeTracker : NewEndpointsChangeTracker ("host1" , nil , v1 .IPv4Protocol , nil , nil ),
1414
+ endpointsChangeTracker : NewEndpointsChangeTracker (v1 .IPv4Protocol , "host1" , nil , nil ),
1415
1415
namespacedName : types.NamespacedName {Name : "svc1" , Namespace : "ns1" },
1416
1416
paramEndpointSlice : generateEndpointSlice ("svc1" , "ns1" , 1 , 2 , 999 , 999 , []string {"host1" }, []* int32 {ptr.To [int32 ](80 ), ptr.To [int32 ](443 )}),
1417
1417
paramRemoveSlice : false ,
@@ -1433,7 +1433,7 @@ func TestEndpointSliceUpdate(t *testing.T) {
1433
1433
generateEndpointSlice ("svc1" , "ns1" , 1 , 3 , 2 , 999 , []string {"host1" }, []* int32 {ptr.To [int32 ](80 ), ptr.To [int32 ](443 )}),
1434
1434
generateEndpointSlice ("svc1" , "ns1" , 2 , 2 , 2 , 999 , []string {"host1" }, []* int32 {ptr.To [int32 ](80 ), ptr.To [int32 ](443 )}),
1435
1435
},
1436
- endpointsChangeTracker : NewEndpointsChangeTracker ("host1" , nil , v1 .IPv4Protocol , nil , nil ),
1436
+ endpointsChangeTracker : NewEndpointsChangeTracker (v1 .IPv4Protocol , "host1" , nil , nil ),
1437
1437
namespacedName : types.NamespacedName {Name : "svc1" , Namespace : "ns1" },
1438
1438
paramEndpointSlice : generateEndpointSlice ("svc1" , "ns1" , 1 , 3 , 3 , 999 , []string {"host1" }, []* int32 {ptr.To [int32 ](80 ), ptr.To [int32 ](443 )}),
1439
1439
paramRemoveSlice : false ,
@@ -1461,7 +1461,7 @@ func TestEndpointSliceUpdate(t *testing.T) {
1461
1461
generateEndpointSlice ("svc1" , "ns1" , 1 , 3 , 2 , 2 , []string {"host1" }, []* int32 {ptr.To [int32 ](80 ), ptr.To [int32 ](443 )}),
1462
1462
generateEndpointSlice ("svc1" , "ns1" , 2 , 2 , 2 , 2 , []string {"host1" }, []* int32 {ptr.To [int32 ](80 ), ptr.To [int32 ](443 )}),
1463
1463
},
1464
- endpointsChangeTracker : NewEndpointsChangeTracker ("host1" , nil , v1 .IPv4Protocol , nil , nil ),
1464
+ endpointsChangeTracker : NewEndpointsChangeTracker (v1 .IPv4Protocol , "host1" , nil , nil ),
1465
1465
namespacedName : types.NamespacedName {Name : "svc1" , Namespace : "ns1" },
1466
1466
paramEndpointSlice : generateEndpointSlice ("svc1" , "ns1" , 1 , 3 , 3 , 2 , []string {"host1" }, []* int32 {ptr.To [int32 ](80 ), ptr.To [int32 ](443 )}),
1467
1467
paramRemoveSlice : false ,
@@ -1521,13 +1521,13 @@ func TestCheckoutChanges(t *testing.T) {
1521
1521
pendingSlices []* discovery.EndpointSlice
1522
1522
}{
1523
1523
"empty slices" : {
1524
- endpointsChangeTracker : NewEndpointsChangeTracker ("" , nil , v1 .IPv4Protocol , nil , nil ),
1524
+ endpointsChangeTracker : NewEndpointsChangeTracker (v1 .IPv4Protocol , "" , nil , nil ),
1525
1525
expectedChanges : []* endpointsChange {},
1526
1526
appliedSlices : []* discovery.EndpointSlice {},
1527
1527
pendingSlices : []* discovery.EndpointSlice {},
1528
1528
},
1529
1529
"adding initial slice" : {
1530
- endpointsChangeTracker : NewEndpointsChangeTracker ("" , nil , v1 .IPv4Protocol , nil , nil ),
1530
+ endpointsChangeTracker : NewEndpointsChangeTracker (v1 .IPv4Protocol , "" , nil , nil ),
1531
1531
expectedChanges : []* endpointsChange {{
1532
1532
previous : EndpointsMap {},
1533
1533
current : EndpointsMap {
@@ -1544,7 +1544,7 @@ func TestCheckoutChanges(t *testing.T) {
1544
1544
},
1545
1545
},
1546
1546
"removing port in update" : {
1547
- endpointsChangeTracker : NewEndpointsChangeTracker ("" , nil , v1 .IPv4Protocol , nil , nil ),
1547
+ endpointsChangeTracker : NewEndpointsChangeTracker (v1 .IPv4Protocol , "" , nil , nil ),
1548
1548
expectedChanges : []* endpointsChange {{
1549
1549
previous : EndpointsMap {
1550
1550
svcPortName0 : []Endpoint {
0 commit comments