Bug 1562337 - Servicebinding cannot be deleted when serviceinstance update to a invalid plan
Summary: Servicebinding cannot be deleted when serviceinstance update to a invalid plan
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Service Catalog
Version: 3.9.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: 3.10.0
Assignee: Paul Morie
QA Contact: Zhang Cheng
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-03-30 08:56 UTC by Zhang Cheng
Modified: 2018-07-30 19:12 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-07-30 19:11:39 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2018:1816 0 None None None 2018-07-30 19:12:03 UTC

Description Zhang Cheng 2018-03-30 08:56:55 UTC
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

Comment 1 Paul Morie 2018-04-02 14:22:35 UTC
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.

Comment 2 Marko Luksa 2018-04-06 13:05:20 UTC
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.

Comment 3 Marko Luksa 2018-05-15 07:57:26 UTC
Fix has been merged. It will be included in v0.1.19 of Service Catalog upstream.

Comment 5 Zhang Cheng 2018-05-18 05:44:57 UTC
Changing status to Modified since downstream image not ready for test.

Comment 6 Zhang Cheng 2018-05-29 05:20:23 UTC
Changing status to ON_QA since downstream image ready for test.

Comment 7 Zhang Cheng 2018-05-29 05:33:53 UTC
Verified and passed follow original test steps.

# service-catalog --version
v3.10.0-0.53.0;Upstream:v0.1.19

Comment 9 errata-xmlrpc 2018-07-30 19:11:39 UTC
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


Note You need to log in before you can comment on or make changes to this bug.