cloudfoundry / cloudfoundry/cloud_controller_ng
CC should refresh instances_retrievable services upon service update
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 207
- Forks
- 373
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 56
Description
Issue
As a developer, in order to have CF refresh its view of a service instance which has been modified out of bands (e.g. using dashboard), I need CF to refresh the service instance following a cf update-service command
Context
Some services instances might be modified out of bands, i.e. modifications are not triggered through the current CF instance. Example related use-cases:
- the service instance was modified through a dashboard
- the service instance is shared among multiple CF deployments, and was modified by another CF deployments
- the service instance is shared among multiple OSB clients (e.g. a K8S osb client), and was modified by another CF deployments
While service brokers can express that the service instances is retrievable by publishing instances_retrievable=true in their catalog, the CC only currently uses this information to fetch service instance parameters using the GET /v2/service_instances/:instance_id broker endpoint, and ignores any updates made to the the service plan Id which remains cached.
Steps to Reproduce
- Deploy a service broker which supports out of bands service plan updates (possibly CATS service_broker or overview-broker)
- cf create-service service-offering plan1 myservice
- update out of band the service instance from plan1 to plan2
- cf update-service myservice
Expected result
cf service myservice and cf services show the service "myservice" with plan2
Current result
cf service myservice and cf services show the service "myservice" with plan1
Possible Fix
When instances_retrievable=true, a cf update-service should systematically trigger call to GET /v2/service_instances/:instance_id broker endpoint, to refresh the service plan, in addition to the dashboard url (as reported in #1390)
Additional details
Related code serving the cached service plan
https://github.com/cloudfoundry/cloud_controller_ng/blob/8b7d8eecd38eecf0df65a122554aa07c54bf9a32/app/controllers/services/service_instances_controller.rb#L153-L156
Related code using the fetch endpoint to serve refreshed service params
https://github.com/cloudfoundry/cloud_controller_ng/blob/8b7d8eecd38eecf0df65a122554aa07c54bf9a32/app/controllers/services/service_instances_controller.rb#L268-L273
https://github.com/cloudfoundry/cloud_controller_ng/blob/65a75e6c97f49756df96e437e253f033415b2db1/spec/unit/actions/services/service_instance_read_spec.rb#L19-L24
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with app/controllers/services/service_instances_controller.rb at the referenced lines, then read spec/unit/actions/services/service_instance_read_spec.rb and the service broker fetch-endpoint behavior. Trace the cf update-service path for instances_retrievable services. Done means an out-of-band plan change is reflected by cf service and cf services after the update command, with coverage for the refreshed plan.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100