spring-cloud/spring-cloud-app-broker

Bug: update a `SpacePerServiceInstance` service with a new backing service fails

Closed this issue · 0 comments

Currently, when updating a SpacePerServiceInstance service with a new backing service, deleteServiceInstance will be triggered to delete the old instance. However, the old service instance retrieved from bound app (getDeployedBackingApplications) doesn't have any properties set, including target, so deletion would fail for service not found. Because of this, the backing app will be bound to both the old and the new services which might result in unexpected errors in the backing app.

Aside from that, if old service is no longer listed, deleteServiceInstance will be triggered to delete the old instance. At the end of deleteServiceInstance when target is set, the method would delete the generated space. We should move deleteSpace to the end of the delete workflow.