Skip to content

CC should refresh instances_retrievable services upon service update #1504

Open
@gberche-orange

Description

@gberche-orange

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

def read(guid)
service_instance = find_guid_and_validate_access(:read, guid, ServiceInstance)
object_renderer.render_json(self.class, service_instance, @opts)
end

Related code using the fetch endpoint to serve refreshed service params

fetcher = ServiceInstanceRead.new
begin
parameters = fetcher.fetch_parameters(service_instance)
[HTTP::OK, parameters.to_json]

it 'calls the broker to fetch parameters' do
expect(fake_broker_client).to receive(:fetch_service_instance).with(service_instance).and_return({})
action = ServiceInstanceRead.new
action.fetch_parameters(service_instance)
end

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions