Cf routes errors when the user cannot see bound routes
Please fill out the issue checklist below and provide ALL the requested information.
- [ ] I reviewed open and closed github issues that may be related to my problem.
- [ ] I tried updating to the latest version of the CF CLI to see if it fixed my problem.
- [x] I attempted to run the command with
CF_TRACE=1to help debug the issue. - [x] I am reporting a bug that others will be able to reproduce.
Describe the bug and the command you saw an issue with
Provide details on what you were trying to do (and why).
using the cf routes command fails if I have access to routes that are bound to apps that I don't have access to. An example of this is when a route has been shared to another space but is still bound to an app in the owning space.
What happened A clear and concise description of what happen.
cf routes
Getting routes for org org / space space2 as alice...
One or more applications were not found.
FAILED
Expected behavior I expect to see:
cf routes │·····························
Getting routes for org org / space space as admin...
space host domain port path protocol apps
some-space dora some-domain http
Exact Steps To Reproduce Steps to reproduce the behavior; include the exact CLI commands and verbose output:
in space 1 as admin...
cf push dora
cf create-space space2
cf share-route domain.com -n dora -s space2
cf create-user alice pass
cf set-space-user alice org space2 spaceDeveloper
cf login -u alice -p pass
cf target space2
cf routes
see error:
Getting routes for org org / space space2 as alice...
One or more applications were not found.
FAILED
Provide more context
running on cli 8.4.0 and edge capi but I expect this to fail on all version of cli
This looks like the offending line: https://github.com/cloudfoundry/cli/blob/94933d7bc9db42526cb293fa8b98a7e5554aae76/actor/v7action/application.go#L102-L104
Note this more of a preemptive bug report because the capi version that supports viewing shared routes is unreleased.
Is this a bug in this case? This looks more like a feature that should be prioritized via regular backlog.
Capi version that breaks cli cf-routes: https://github.com/cloudfoundry/capi-release/releases/tag/1.141.0
To me this is a bug since cf-routes is broken for users that use a released feature (route sharing).