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
cloud_controller_ng/app/controllers/services/service_instances_controller.rb
Lines 153 to 156 in 8b7d8ee
Related code using the fetch endpoint to serve refreshed service params
cloud_controller_ng/app/controllers/services/service_instances_controller.rb
Lines 268 to 273 in 8b7d8ee