Skip to content

Commit

Permalink
fix test file
Browse files Browse the repository at this point in the history
  • Loading branch information
jmurret committed Oct 24, 2023
1 parent f8c81b6 commit ec5af3c
Showing 1 changed file with 1 addition and 21 deletions.
22 changes: 1 addition & 21 deletions internal/mesh/internal/controllers/xds/controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1080,51 +1080,31 @@ func (suite *xdsControllerTestSuite) addRequiredEndpointsAndRefs(pst *pbmesh.Pro
var vp uint32 = 7000
requiredEps := make(map[string]*pbproxystate.EndpointRef)

<<<<<<< HEAD
// get service name and ports
=======
// iterate through clusters and set up endpoints for cluster/mesh port.
>>>>>>> 158caa2516 (clean up test to use helper.)
for clusterName := range pst.ProxyState.Clusters {
if clusterName == "null_route_cluster" || clusterName == "original-destination" {
continue
}
<<<<<<< HEAD
vp++
separator := "."
if proxyType == "source" {
separator = ":"
}
clusterNameSplit := strings.Split(clusterName, separator)
port := clusterNameSplit[0]
svcName := clusterNameSplit[1]
=======

//increment the random port number.
vp++
clusterNameSplit := strings.Split(clusterName, ".")
port := clusterNameSplit[0]
svcName := clusterNameSplit[1]

// set up service data with port info.
>>>>>>> 158caa2516 (clean up test to use helper.)
serviceData.Ports = append(serviceData.Ports, &pbcatalog.ServicePort{
TargetPort: port,
VirtualPort: vp,
Protocol: pbcatalog.Protocol_PROTOCOL_TCP,
})

<<<<<<< HEAD
=======
// create service.
>>>>>>> 158caa2516 (clean up test to use helper.)
svc := resourcetest.Resource(pbcatalog.ServiceType, svcName).
WithData(suite.T(), &pbcatalog.Service{}).
Write(suite.T(), suite.client)

<<<<<<< HEAD
=======
// create endpoints with svc as owner.
>>>>>>> 158caa2516 (clean up test to use helper.)
eps := resourcetest.Resource(pbcatalog.ServiceEndpointsType, svcName).
WithData(suite.T(), &pbcatalog.ServiceEndpoints{Endpoints: []*pbcatalog.Endpoint{
{
Expand Down

0 comments on commit ec5af3c

Please sign in to comment.