Description of problem: When servicebinding exist, deleteing templateinstance will conduct the unbind operation failed. The failed reason is that the related templateinstance not found. It's better to prompt message like serviceinstance behavior "Delete instance blocked by existing ServiceBindings associated with this instance. All credentials must be removed first" when delete templateinstance with servicebinding existing Version-Release number of selected component (if applicable): Server https://***:443 openshift v3.9.0-0.34.0 kubernetes v1.9.1+a0ce1bc65 How reproducible: alwyas Steps to Reproduce: 1.Priovision a mongodb serviceclass from browse catalog 2.Create a binding 3.After serviceinstance and servicebinding ready, deprovision templateinstance 4.Unbind the servicebinding Actual results: 4.Servicebinding will be marked as deletion $oc get servicebinding mongodb-ephemeral-fgl2f-bdg6r -o yaml <----------------snip----------------> status: conditions: - lastTransitionTime: 2018-02-01T02:51:43Z message: 'Unbind call failed. Error unbinding from ServiceInstance "xiu3/mongodb-ephemeral-fgl2f" of ClusterServiceClass (K8S: "9321a362-062c-11e8-9135-fa163eac540c" ExternalName: "mongodb-ephemeral") at ClusterServiceBroker "template-service-broker": Status: 500; ErrorMessage: <nil>; Description: templateinstances.template.openshift.io "eaaf751e-4118-4473-8cd8-b505243bcdea" not found; ResponseError: <nil>' reason: UnbindCallFailed status: Unknown type: Ready - lastTransitionTime: 2018-02-01T02:51:43Z message: 'Unbind call failed. Error unbinding from ServiceInstance "xiu3/mongodb-ephemeral-fgl2f" of ClusterServiceClass (K8S: "9321a362-062c-11e8-9135-fa163eac540c" ExternalName: "mongodb-ephemeral") at ClusterServiceBroker "template-service-broker": Status: 500; ErrorMessage: <nil>; Description: templateinstances.template.openshift.io "eaaf751e-4118-4473-8cd8-b505243bcdea" not found; ResponseError: <nil>' reason: UnbindCallFailed status: "True" type: Failed <-------------snip-----------------> Expected results: Should prompt warning for deleting tempalteinstance when serivicebinding exist Additional info:
I don't foresee us prompting the user to prevent them from deleting a templateinstance that has bindings (though if we did, that would be a web console thing, so maybe an RFE should be opened against it. you'd still always be able to just "oc delete" it though and we're never going to prevent that). As for the behavior of the TSB's unbind operation, when the template instance in question no longer exists, I suspect the TSB is "working as designed" here, but I defer to Paul Morie if he thinks the TSB should return some other response on the unbind request. Jim Minter may have some insight as to the expected/intended/agreed upon behavior also, so adding him to the CC. Marking low severity as you have to semi-intentionally get yourself in this situation.
(I think we're hitting this codepath: https://github.com/openshift/origin/blob/ddd1f926d749c914e479b2c54e385137a99873c2/pkg/templateservicebroker/servicebroker/unbind.go#L48 it's possible we should explicitly check for IsNotFound(err) on the templateinstance lookup and just return a StatusGone message if we get one, will double check w/ Jim when he gets back, or if Paul has insight)
*** Bug 1535171 has been marked as a duplicate of this bug. ***
Commit pushed to master at https://github.com/openshift/origin https://github.com/openshift/origin/commit/495739248a10c95768b0a743ad0e7fcf34ef04db Merge pull request #18416 from bparees/tsb_binding Automatic merge from submit-queue. return gone on unbind from non-existent templateinstance bug 1540819 https://bugzilla.redhat.com/show_bug.cgi?id=1540819
*** Bug 1538370 has been marked as a duplicate of this bug. ***
The fix has merged into ocp v3.9.0-0.42.0. And can't reproduce this bug. Please help set to on_qa when you are free
As comment #9, move this bug to verified
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHSA-2018:2013