Skip to content

Commit

Permalink
Removing all the changes in cf/commands
Browse files Browse the repository at this point in the history
  • Loading branch information
Dariquest committed Jan 20, 2025
1 parent 38b8fe8 commit 60eec2e
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 23 deletions.
2 changes: 1 addition & 1 deletion cf/actors/push_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ var _ = Describe("Push Actor", func() {
}

_ = actor.MapManifestRoute("route-name.example.com/testPath", app, appParamsFromContext)
actualRoute, actualApp, actualAppParams, _ := routeActor.FindAndBindRouteArgsForCall(0)
actualRoute, actualApp, actualAppParams := routeActor.FindAndBindRouteArgsForCall(0)
Expect(actualRoute).To(Equal("route-name.example.com/testPath"))
Expect(actualApp).To(Equal(app))
Expect(actualAppParams).To(Equal(appParamsFromContext))
Expand Down
7 changes: 0 additions & 7 deletions cf/api/routes.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,13 +180,6 @@ func (repo CloudControllerRouteRepository) CreateInSpace(host, path, domainGUID,

resource := new(resources.RouteResource)

/*for _, option := range options {
key, value, found := strings.Cut(option, "=")
if found {
resource.Entity.Options[key] = value
}
}*/

err = repo.gateway.CreateResource(
repo.config.APIEndpoint(),
uriFragment,
Expand Down
3 changes: 1 addition & 2 deletions cf/commands/application/push_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -553,8 +553,7 @@ var _ = Describe("Push Command", func() {
}

callCount := 0
routeActor.FindOrCreateRouteStub = func(hostname string, domain models.DomainFields, path string, _ int, useRandomPort bool,
) (models.Route, error) {
routeActor.FindOrCreateRouteStub = func(hostname string, domain models.DomainFields, path string, _ int, useRandomPort bool) (models.Route, error) {
callCount = callCount + 1
switch callCount {
case 1:
Expand Down
14 changes: 6 additions & 8 deletions cf/commands/route/routefakes/old_fake_route_creator.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
)

type OldFakeRouteCreator struct {
CreateRouteStub func(hostName string, path string, port int, randomPort bool, domain models.DomainFields, space models.SpaceFields, options []string) (route models.Route, apiErr error)
CreateRouteStub func(hostName string, path string, port int, randomPort bool, domain models.DomainFields, space models.SpaceFields) (route models.Route, apiErr error)
createRouteMutex sync.RWMutex
createRouteArgsForCall []struct {
hostName string
Expand All @@ -20,15 +20,14 @@ type OldFakeRouteCreator struct {
randomPort bool
domain models.DomainFields
space models.SpaceFields
options []string
}
createRouteReturns struct {
result1 models.Route
result2 error
}
}

func (fake *OldFakeRouteCreator) CreateRoute(hostName string, path string, port int, randomPort bool, domain models.DomainFields, space models.SpaceFields, options []string) (route models.Route, apiErr error) {
func (fake *OldFakeRouteCreator) CreateRoute(hostName string, path string, port int, randomPort bool, domain models.DomainFields, space models.SpaceFields) (route models.Route, apiErr error) {
fake.createRouteMutex.Lock()
fake.createRouteArgsForCall = append(fake.createRouteArgsForCall, struct {
hostName string
Expand All @@ -37,11 +36,10 @@ func (fake *OldFakeRouteCreator) CreateRoute(hostName string, path string, port
randomPort bool
domain models.DomainFields
space models.SpaceFields
options []string
}{hostName, path, port, randomPort, domain, space, options})
}{hostName, path, port, randomPort, domain, space})
fake.createRouteMutex.Unlock()
if fake.CreateRouteStub != nil {
return fake.CreateRouteStub(hostName, path, port, randomPort, domain, space, options)
return fake.CreateRouteStub(hostName, path, port, randomPort, domain, space)
} else {
return fake.createRouteReturns.result1, fake.createRouteReturns.result2
}
Expand All @@ -53,10 +51,10 @@ func (fake *OldFakeRouteCreator) CreateRouteCallCount() int {
return len(fake.createRouteArgsForCall)
}

func (fake *OldFakeRouteCreator) CreateRouteArgsForCall(i int) (string, string, int, bool, models.DomainFields, models.SpaceFields, []string) {
func (fake *OldFakeRouteCreator) CreateRouteArgsForCall(i int) (string, string, int, bool, models.DomainFields, models.SpaceFields) {
fake.createRouteMutex.RLock()
defer fake.createRouteMutex.RUnlock()
return fake.createRouteArgsForCall[i].hostName, fake.createRouteArgsForCall[i].path, fake.createRouteArgsForCall[i].port, fake.createRouteArgsForCall[i].randomPort, fake.createRouteArgsForCall[i].domain, fake.createRouteArgsForCall[i].space, fake.createRouteArgsForCall[i].options
return fake.createRouteArgsForCall[i].hostName, fake.createRouteArgsForCall[i].path, fake.createRouteArgsForCall[i].port, fake.createRouteArgsForCall[i].randomPort, fake.createRouteArgsForCall[i].domain, fake.createRouteArgsForCall[i].space
}

func (fake *OldFakeRouteCreator) CreateRouteReturns(result1 models.Route, result2 error) {
Expand Down
11 changes: 6 additions & 5 deletions cf/models/route.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ import (
)

type Route struct {
GUID string
Host string
Domain DomainFields
Path string
Port int
GUID string
Host string
Domain DomainFields
Path string
Port int

Space SpaceFields
Apps []ApplicationFields
ServiceInstance ServiceInstanceFields
Expand Down

0 comments on commit 60eec2e

Please sign in to comment.