Bug 1469448 - Need provide method to update broker status not only recreate
Summary: Need provide method to update broker status not only recreate
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Service Broker
Version: 3.6.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: 3.7.0
Assignee: Paul Morie
QA Contact: Zhang Cheng
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-07-11 09:45 UTC by DeShuai Ma
Modified: 2017-11-28 22:00 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-11-28 22:00:46 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2017:3188 0 normal SHIPPED_LIVE Moderate: Red Hat OpenShift Container Platform 3.7 security, bug, and enhancement update 2017-11-29 02:34:54 UTC

Description DeShuai Ma 2017-07-11 09:45:13 UTC
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 15:45:19 UTC
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 15:55:28 UTC
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 21:06:16 UTC
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 06:46:45 UTC
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.

Comment 7 errata-xmlrpc 2017-11-28 22:00:46 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/RHSA-2017:3188


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