Bug 1469448 - Need provide method to update broker status not only recreate
Need provide method to update broker status not only recreate
Status: VERIFIED
Product: OpenShift Container Platform
Classification: Red Hat
Component: Service Broker (Show other bugs)
3.6.0
Unspecified Unspecified
medium Severity medium
: ---
: 3.7.0
Assigned To: Paul Morie
Zhang Cheng
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2017-07-11 05:45 EDT by DeShuai Ma
Modified: 2017-11-02 14:26 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description DeShuai Ma 2017-07-11 05:45:13 EDT
Description of problem:
Current status: after create broker, controller-manager only fetch /catalog once. The serviceclass can't be update even the broker update unless I recreate the broker. So there is issue how keep serviceclass consistency with the server-broker.

User case: 1) Now in ansible-server-broker there is interface bootstrap, we also can use 'apb bootstrap' command to trigger the spec update. But after ansible-service-broker update. the serviceclass is still old.
2) When broker url changed, the serviceclass is still old

Version-Release number of selected component (if applicable):
openshift v3.6.136
kubernetes v1.6.1+5115d708d7
etcd 3.2.1

How reproducible:
Always

Steps to Reproduce:
//case1
1. Create asb broker
[root@ip-172-18-6-17 asb]# oc get broker
NAME                     KIND
ansible-service-broker   Broker.v1alpha1.servicecatalog.k8s.io

2. Check the serviceclass and apb image
(apb) [root@dma service-catalog]# apb list --broker asb-1338-openshift-ansible-service-broker.0711-l6i.qe.rhcloud.com
ID                                    NAME                  DESCRIPTION                        
55c53a5d-65a6-4c27-88fc-e027410b1337  mediawiki123-apb      Mediawiki123 apb implementation    
8a049637-8c70-4434-993c-a15c3d310513  rhscl-postgresql-apb  SCL PostgreSQL apb implementation  
[root@ip-172-18-6-17 asb]# oc get serviceclass
NAME                   KIND
mediawiki123-apb       ServiceClass.v1alpha1.servicecatalog.k8s.io
rhscl-postgresql-apb   ServiceClass.v1alpha1.servicecatalog.k8s.io

3. Remove some apb images to asb and trigger asb bootstrap
(apb) [root@dma service-catalog]# apb bootstrap --broker asb-1338-openshift-ansible-service-broker.0711-l6i.qe.rhcloud.com
Successfully bootstrapped Ansible Service Broker
(apb) [root@dma service-catalog]# apb list --broker asb-1338-openshift-ansible-service-broker.0711-l6i.qe.rhcloud.com
ID                                    NAME                  DESCRIPTION                        
8a049637-8c70-4434-993c-a15c3d310513  rhscl-postgresql-apb  SCL PostgreSQL apb implementation  
4. Check the serviceclass again
[root@ip-172-18-6-17 asb]# oc get serviceclass
NAME                   KIND
mediawiki123-apb       ServiceClass.v1alpha1.servicecatalog.k8s.io
rhscl-postgresql-apb   ServiceClass.v1alpha1.servicecatalog.k8s.io

//case2
1. Create asb broker
2. Check the serviceclass
3. Update url of broker resource to wrong
4. Check the serviceclass again
[root@ip-172-18-6-17 asb]# oc get broker ansible-service-broker -o json
{
    "apiVersion": "servicecatalog.k8s.io/v1alpha1",
    "kind": "Broker",
    "metadata": {
        "creationTimestamp": "2017-07-11T06:16:59Z",
        "finalizers": [
            "kubernetes-incubator/service-catalog"
        ],
        "name": "ansible-service-broker",
        "resourceVersion": "27473",
        "selfLink": "/apis/servicecatalog.k8s.io/v1alpha1/brokersansible-service-broker",
        "uid": "8c243b54-6600-11e7-973f-0a580a810003"
    },
    "spec": {
        "url": "http://asb.openshift-ansible-service-broker.svc:13300f0f"
    },
    "status": {
        "conditions": [
            {
                "lastTransitionTime": "2017-07-11T06:16:59Z",
                "message": "Successfully fetched catalog entries from broker.",
                "reason": "FetchedCatalog",
                "status": "True",
                "type": "Ready"
            }
        ]
    }
}
[root@ip-172-18-6-17 asb]# oc get serviceclass
NAME                   KIND
mediawiki123-apb       ServiceClass.v1alpha1.servicecatalog.k8s.io
rhscl-postgresql-apb   ServiceClass.v1alpha1.servicecatalog.k8s.io


Actual results:
4. The serviceclass is still old.

Expected results:
4. The serviceclass should can be auto update.

Additional info:
Comment 1 Paul Morie 2017-07-12 11:45:19 EDT
One thing to note is that the controller will re-list the broker according to an interval which is currently defined as a property of the service catalog controller.  So, the controller will definitely eventually relist the broker.

What we want to move to is:

1.  An API field that sets the resync interval on a broker-specific basis
2.  A porcelain command that allows the broker to be re-listed on demand

The ansible broker team has volunteered to implement these things, and I have a meeting today to discuss it with them.

Also, the broker should definitely be re-listed right away when the broker's spec is change.  That part is a bug and will be fixed.
Comment 2 Paul Morie 2017-07-12 11:55:28 EDT
Created https://github.com/kubernetes-incubator/service-catalog/issues/1018 to relist the broker immediately when the spec is changed.  I don't consider this a blocker for 3.6 but I would like to ship the fix with 3.6 if possible.
Comment 3 Paul Morie 2017-10-11 17:06:16 EDT
There are now two ways you can specify that a broker should be relisted:

- A spec.relistBehavior field which can be "Manual" (relist the broker only when the user specifies) or "Duration" (relist on an internal, as specified by the spec.relistDuration field)
- A spec.relistRequests field the user can bump to indicate that they want the broker to be relisted
Comment 4 Zhang Cheng 2017-10-12 02:46:45 EDT
The fix LGTM except case2 in above description, it can be traced by another BZ https://bugzilla.redhat.com/show_bug.cgi?id=1499413

Verified in here.

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