Skip to content

Incorrect route is added/removed when using cf map-route/unmap-route with context path routes #792

@d-reinhold

Description

@d-reinhold

Command

cf map-route/unmap-route

CLI Version

6.16.1+924508c-2016-02-26

Error

Suppose we have the following apps and routes...

$ cf routes
Getting routes for org system / space test as admin ...

space   host          domain                   path   apps        service
test    shared-host   example.com              /2     app1
test    shared-host   example.com                     app1,app2

..and we want to remove the shared-host route with no context path:

$ cf unmap-route app1 example.com --hostname shared-host
Removing route shared-host.example.com/2 from app app1 in org system / space test as admin...
OK

$ cf routes
Getting routes for org system / space test as admin ...

space   host          domain                   path   apps        service
test    shared-host   example.com              /2
test    shared-host   example.com                     app1,app2

It removed the wrong route! So we run the same unmap command again:

$ cf unmap-route app1 example.com --hostname shared-host
Removing route shared-host.example.com/2 from app app1 in org system / space test as admin...
OK

Route to be unmapped is not currently mapped to the application.

$ cf routes
Getting routes for org system / space test as admin ...

space   host          domain                   path   apps        service
test    shared-host   example.com              /2
test    shared-host   example.com                     app1,app2

Now it is impossible to remove the desired route from app1.
The same issue occurs when using cf map-route; the incorrect route may be selected.

I believe this issue was introduced in commit 9826b73, which was motivated by this Tracker story:
https://www.pivotaltracker.com/story/show/113911793

CC API Version

2.43.0

Platform Details

Mac OS X 10.10.4

Shell

iTerm2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions