Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CF update-service has no option to update dashboard URL #995

Closed
kamath-prasad opened this issue Nov 15, 2017 · 8 comments
Closed

CF update-service has no option to update dashboard URL #995

kamath-prasad opened this issue Nov 15, 2017 · 8 comments

Comments

@kamath-prasad
Copy link

Thanks for submitting an issue to cloud_controller_ng. We are always trying to improve! To help us, please fill out the following template.

Issue

"cf update-service" does not provide any option to update the dashboard URL

Context

  1. Currently we use the dashboard_url parameter (https://apidocs.cloudfoundry.org/272/service_instances/creating_a_service_instance.html) to set the service instance dashboard URL while creating a new service instance .

  2. We provide the instance id , plan id and other needed details in the URL that can be used to render the details in the dashboard. The dashboard is rendered by the custom code in the service broker.

  3. When the instance plan gets updated via "cf update-service" , we see that the dashboard url remains unchanged since there is no option to update the value for dashboard_url . This leads to incorrect rendering of details in the instance dashboard.

Steps to Reproduce

  1. create an instance by passing a value for dashboard_url in the response body.
  2. update of the same instance has no option to take in updated value for dashboard_url.

Expected result

update of the same instance should have an option to take in updated value for dashboard_url.

Current result

update of the same instance does not have an option to take in updated value for dashboard_url.

Possible Fix

Enhanced the update service code to provide an option to read the dashboard_url from the response body of broker and keep updating the value of dashboard_url that is set during instance provisioning.

@cf-gitbot
Copy link

We have created an issue in Pivotal Tracker to manage this:

https://www.pivotaltracker.com/story/show/152878973

The labels on this github issue will be updated when the story is started.

@zrob
Copy link
Contributor

zrob commented Nov 28, 2017

Hi @kamath-prasad

The dashboard url is a field that is managed by the broker and not by users. It is not intended for a user to update this field, since this could cause it to no longer match what the broker is expecting to present a management interface.

When you run cf update-service this results in a call to the broker. If the broker were to return a new dashboard url, then the value would be updated.

@kamath-prasad
Copy link
Author

@zrob : We tried sending a value for dashboard_url attribute in the response body , but see that the cloud controller code does not have any hook to update the value of dashboard_url and the value never gets updated .

Hook only present in create -

dashboard_url: parsed_response['dashboard_url']

No hook to update the value in update method -

def update(instance, plan, accepts_incomplete: false, arbitrary_parameters: nil, previous_values: {})
path = service_instance_resource_path(instance, accepts_incomplete: accepts_incomplete)
body = {
service_id: instance.service.broker_provided_id,
plan_id: plan.broker_provided_id,
previous_values: previous_values,
context: context_hash(instance)
}
body[:parameters] = arbitrary_parameters if arbitrary_parameters
response = @http_client.patch(path, body)
parsed_response = @response_parser.parse_update(path, response)
last_operation_hash = parsed_response['last_operation'] || {}
state = last_operation_hash['state'] || 'succeeded'
attributes = {
last_operation: {
type: 'update',
state: state,
description: last_operation_hash['description'] || '',
broker_provided_operation: async_response?(response) ? parsed_response['operation'] : nil
},
}
if state == 'succeeded'
attributes[:service_plan] = plan
elsif state == 'in progress'
attributes[:last_operation][:proposed_changes] = { service_plan_guid: plan.guid }
end
return attributes, nil
rescue Errors::ServiceBrokerBadResponse,
Errors::ServiceBrokerApiTimeout,
Errors::ServiceBrokerResponseMalformed,
Errors::ServiceBrokerRequestRejected,
Errors::AsyncRequired => e
attributes = {
last_operation: {
state: 'failed',
type: 'update',
description: e.message
}
}
return attributes, e
end

Can you please confirm this understanding ?

@zrob
Copy link
Contributor

zrob commented Jun 4, 2018

@kamath-prasad

The service broker api recently merged a change to allow this here openservicebrokerapi/servicebroker#437

Pinging the SAPI team about plans to add support @mattmcneeney

@kamath-prasad
Copy link
Author

@zrob : Thanks for the update ! We actually made a workaround recently in our broker to handle the flow in update case as well - cloudfoundry/service-fabrik-broker#277 .

However it will be great if platform handles this as we can avoid additional calls to CC !!

@mattmcneeney : please let us ETA once this item gets picked up implementation.

@mattmcneeney
Copy link

Hey @kamath-prasad
I'm glad to hear this will help the service-fabrik-broker and avoid additional calls back into the platform!
You can track the story here (let me know if you can't access that story) and we're hoping to have that in a CF deployment in the next couple of weeks. We'll make sure to close this issue when it's ready.

@zrob
Copy link
Contributor

zrob commented Jun 7, 2018

@Samze
Copy link
Contributor

Samze commented Jun 19, 2018

@kamath-prasad This has now been merged in CloudController, it should make it into a CAPI release shortly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants