Description of problem: Servicebinding cannot be deleted when serviceinstance update to a invalid plan Message of description for servicebinding: # oc describe servicebinding ... ... Status: Async Op In Progress: false Conditions: Last Transition Time: 2018-03-30T08:38:38Z Message: Unbind request for ServiceBinding in-flight to Broker Reason: UnbindingRequestInFlight Status: False Type: Ready Current Operation: Unbind service-catalog & asb image using images from downstream registry: # service-catalog --version v0.1.9 # asbd --version 1.1.17 How reproducible: Always Steps to Reproduce: 1. Provision a postgreSQL serviceinstance from web console. 2. Create a servicebinding from web console. 3. Update plan of serviceinstance to a invalid value, such as: "dev" --> "xxx" 4. Delete the servicebinding Actual results: 4. Servicebinding cannot be deleted. # oc describe serviceinstance Name: rh-postgresql-apb-n8n8j Namespace: chezhang-test Labels: <none> Annotations: <none> API Version: servicecatalog.k8s.io/v1beta1 Kind: ServiceInstance Metadata: Creation Timestamp: 2018-03-30T08:36:53Z Finalizers: kubernetes-incubator/service-catalog Generate Name: rh-postgresql-apb- Generation: 2 Resource Version: 52704 Self Link: /apis/servicecatalog.k8s.io/v1beta1/namespaces/chezhang-test/serviceinstances/rh-postgresql-apb-n8n8j UID: 7fb95eab-33f5-11e8-b3a5-0a580a800005 Spec: Cluster Service Class External Name: rh-postgresql-apb Cluster Service Class Ref: Name: d5915e05b253df421efe6e41fb6a66ba Cluster Service Plan External Name: xxx External ID: e8bb6533-f3a2-40eb-af7a-973c32bfb1b3 Parameters From: Secret Key Ref: Key: parameters Name: rh-postgresql-apb-parameterssgsbe Update Requests: 0 User Info: Groups: system:cluster-admins system:masters system:authenticated UID: Username: system:admin Status: Async Op In Progress: false Conditions: Last Transition Time: 2018-03-30T08:38:12Z Message: The instance references a ClusterServicePlan that does not exist. References a non-existent ClusterServicePlan (K8S: "" ExternalName: "xxx") on ClusterServiceClass (K8S: "d5915e05b253df421efe6e41fb6a66ba" ExternalName: "rh-postgresql-apb") or there is more than one (found: 0) Reason: ReferencesNonexistentServicePlan Status: False Type: Ready Deprovision Status: Required External Properties: Cluster Service Plan External ID: 9783fc2e859f9179833a7dd003baa841 Cluster Service Plan External Name: dev Parameter Checksum: dbac93dc4526449a7c2650fa3916e9370052e331128cba9d8d3c0567393fa453 Parameters: Postgresql _ Database: <redacted> Postgresql _ Password: <redacted> Postgresql _ User: <redacted> Postgresql _ Version: <redacted> User Info: Extra: Scopes . Authorization . Openshift . Io: user:full Groups: system:authenticated:oauth system:authenticated UID: Username: chezhang Orphan Mitigation In Progress: false Reconciled Generation: 1 Events: Type Reason Age From Message ---- ------ ---- ---- ------- Warning ErrorWithParameters 1m service-catalog-controller-manager failed to prepare parameters nil: secrets "rh-postgresql-apb-parameterssgsbe" not found Normal Provisioning 1m service-catalog-controller-manager The instance is being provisioned asynchronously Normal ProvisionedSuccessfully 1m service-catalog-controller-manager The instance was provisioned successfully Warning ReferencesNonexistentServicePlan 3s (x11 over 7s) service-catalog-controller-manager References a non-existent ClusterServicePlan (K8S: "" ExternalName: "xxx") on ClusterServiceClass (K8S: "d5915e05b253df421efe6e41fb6a66ba" ExternalName: "rh-postgresql-apb") or there is more than one (found: 0) # oc delete servicebinding rh-postgresql-apb-n8n8j-tgg5k servicebinding "rh-postgresql-apb-n8n8j-tgg5k" deleted # oc get servicebinding NAME AGE rh-postgresql-apb-n8n8j-tgg5k 56s # oc describe servicebinding Name: rh-postgresql-apb-n8n8j-tgg5k Namespace: chezhang-test Labels: <none> Annotations: <none> API Version: servicecatalog.k8s.io/v1beta1 Kind: ServiceBinding Metadata: Creation Timestamp: 2018-03-30T08:37:48Z Deletion Grace Period Seconds: 0 Deletion Timestamp: 2018-03-30T08:38:38Z Finalizers: kubernetes-incubator/service-catalog Generate Name: rh-postgresql-apb-n8n8j- Generation: 2 Resource Version: 52775 Self Link: /apis/servicecatalog.k8s.io/v1beta1/namespaces/chezhang-test/servicebindings/rh-postgresql-apb-n8n8j-tgg5k UID: a070bf48-33f5-11e8-b3a5-0a580a800005 Spec: External ID: 6aa1801b-6a86-4d05-be8f-176e3131bf79 Instance Ref: Name: rh-postgresql-apb-n8n8j Secret Name: rh-postgresql-apb-n8n8j-credentials-80qcx User Info: Groups: system:cluster-admins system:masters system:authenticated UID: Username: system:admin Status: Async Op In Progress: false Conditions: Last Transition Time: 2018-03-30T08:38:38Z Message: Unbind request for ServiceBinding in-flight to Broker Reason: UnbindingRequestInFlight Status: False Type: Ready Current Operation: Unbind External Properties: User Info: Extra: Scopes . Authorization . Openshift . Io: user:full Groups: system:authenticated:oauth system:authenticated UID: Username: chezhang Operation Start Time: 2018-03-30T08:38:38Z Orphan Mitigation In Progress: false Reconciled Generation: 1 Unbind Status: Required Events: Type Reason Age From Message ---- ------ ---- ---- ------- Normal InjectedBindResult 1m service-catalog-controller-manager Injected bind result Expected results: 4. Servicebinding should be deleted succeed. Addition info: None
Jay, would you take a look at this? I don't think you should be able to update to a plan that we know is invalid. We already have an admission controller runs against instance updates to make sure that the plan is updateable. We could extend that controller to ensure that the requested plan actually exists to avoid getting into the 'invalid plan' state to begin with.
PR with the fix: https://github.com/kubernetes-incubator/service-catalog/pull/1922 We can't have the admission control plugin prevent users from pointing to a non-existent plan, because the plan may appear later.
Fix has been merged. It will be included in v0.1.19 of Service Catalog upstream.
Changing status to Modified since downstream image not ready for test.
Changing status to ON_QA since downstream image ready for test.
Verified and passed follow original test steps. # service-catalog --version v3.10.0-0.53.0;Upstream:v0.1.19
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/RHBA-2018:1816