cloudfoundry / cloud_controller_ng

Cloud Foundry Cloud Controller
Apache License 2.0
193 stars 359 forks source link

Missing service offerings are not removed upon `cf update-service-broker` and don't issue warnings #1911

Closed gberche-orange closed 3 years ago

gberche-orange commented 4 years ago

Issue

a service broker that is evolving its catalog by removing some service offerings (but not service plans) never gets its old service offerings removed from CC

diagnostic message of failed cf update-service-broker is unfriendly in the following scenario

Context

As a CF admin

Steps to Reproduce

Expected result

Warning: Service plans are missing from the broker's catalog (https://osb-reverse-proxy-1.internal-controlplane-cf.paas/v2/catalog) but can not be removed from Cloud Foundry while instances exist. The plans have been deactivated to prevent users from attempting to provision new instances of these plans. The broker should continue to support bind, unbind, and delete for existing instances; if these operations fail contact your broker provider.

Service Offering: overview-service (guid=G1)
Plans deactivated: small (guid=S1)

This would be similar to https://github.com/cloudfoundry/cloud_controller_ng/blob/17402a48fe38e2f0f8cc36a316e60427fc79f0f1/lib/services/service_brokers/service_manager.rb#L175-L181

Current result

cf-gitbot commented 4 years ago

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

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

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

blgm commented 3 years ago

@gberche-orange, I have managed to re-create this using the instructions above using both V2 and V3 endpoints. The subtlety is to update the service name and ID, but not to change the plan name or ID.

This what OSBAPI says about the plan ID:

An identifier used to correlate this Service Plan in future requests to the Service Broker. This MUST be globally unique such that Platforms (and their users) MUST be able to assume that seeing the same value (no matter what Service Broker uses it) will always refer to this Service Plan and for the same Service Offering. MUST be a non-empty string. Using a GUID is RECOMMENDED.

Also see https://github.com/openservicebrokerapi/servicebroker/issues/306 for a discussion about the plan ID being globally unique.

Because a plan ID is globally unique, it is an error to change a service ID without changing the plan ID (because the same plan ID value will always refer to this Service Plan and for the same Service Offering). But how should a platform handle this error?

I'm thinking that catalog validation should fail in a way that's analogous to having a duplicate plan ID. Something like plan ID abc... is already used by another service. What are your thoughts?

gberche-orange commented 3 years ago

thanks @blgm for looking into this issue !

Because a plan ID is globally unique, it is an error to change a service ID without changing the plan ID (because the same plan ID value will always refer to this Service Plan and for the same Service Offering). But how should a platform handle this error?

I'm thinking that catalog validation should fail in a way that's analogous to having a duplicate plan ID. Something like plan ID abc... is already used by another service. What are your thoughts?

+1 for failing the service catalog in this case.

I think it would be useful to hint the service broker operator/author with a more specific message

elenasharma commented 3 years ago

The fix for this issue was released in capi-release 1.105. Thank you for raising this issue!

gberche-orange commented 3 years ago

Great thanks @blgm and @elenasharma !