Bug 1503523

Summary: Deprovision of MySQL (APB) does not work
Product: OpenShift Container Platform Reporter: Weihua Meng <wmeng>
Component: Service BrokerAssignee: David Zager <dzager>
Status: CLOSED DUPLICATE QA Contact: Weihua Meng <wmeng>
Severity: high Docs Contact:
Priority: high    
Version: 3.7.0CC: aos-bugs, dzager, jmatthew, xtian
Target Milestone: ---   
Target Release: 3.7.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-11-02 15:30:57 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
asb log none

Comment 1 Weihua Meng 2017-10-18 11:22:49 UTC
Created attachment 1340126 [details]
asb log

Comment 4 Weihua Meng 2017-10-30 09:33:31 UTC
Fixed.

$ oc get all -n wmeng1
No resources found.
$ oc get serviceinstance -n wmeng1
No resources found.

openshift3/ose-ansible-service-broker:v3.7.0-0.185.0

Comment 5 Weihua Meng 2017-10-30 10:08:47 UTC
NOT fixed.
openshift3/ose-ansible-service-broker:v3.7.0-0.185.0

When deprovision finished.

# oc get all -n wmeng1
NAME               READY     STATUS    RESTARTS   AGE
po/mysql-1-wgdkv   1/1       Running   0          1m

NAME         DESIRED   CURRENT   READY     AGE
rc/mysql-1   1         1         1         1m

# oc get serviceinstance -n wmeng1
No resources found.

Please ignore comment4, incorrect APB used. Sorry.

Comment 6 Xiaoli Tian 2017-10-31 08:11:24 UTC
(In reply to Weihua Meng from comment #5)
> NOT fixed.
> openshift3/ose-ansible-service-broker:v3.7.0-0.185.0
> 
> When deprovision finished.
> 
> # oc get all -n wmeng1
> NAME               READY     STATUS    RESTARTS   AGE
> po/mysql-1-wgdkv   1/1       Running   0          1m
> 
> NAME         DESIRED   CURRENT   READY     AGE
> rc/mysql-1   1         1         1         1m
> 
> # oc get serviceinstance -n wmeng1
> No resources found.
> 
> Please ignore comment4, incorrect APB used. Sorry.

Since this is related to APB, can you please provide the exact tested version of APB?

Comment 7 Weihua Meng 2017-10-31 08:13:23 UTC
(In reply to Xiaoli Tian from comment #6)
> (In reply to Weihua Meng from comment #5)
> > NOT fixed.
> > openshift3/ose-ansible-service-broker:v3.7.0-0.185.0
> > 
> > When deprovision finished.
> > 
> > # oc get all -n wmeng1
> > NAME               READY     STATUS    RESTARTS   AGE
> > po/mysql-1-wgdkv   1/1       Running   0          1m
> > 
> > NAME         DESIRED   CURRENT   READY     AGE
> > rc/mysql-1   1         1         1         1m
> > 
> > # oc get serviceinstance -n wmeng1
> > No resources found.
> > 
> > Please ignore comment4, incorrect APB used. Sorry.
> 
> Since this is related to APB, can you please provide the exact tested
> version of APB?

APB does not have version for now.

Comment 9 Weihua Meng 2017-10-31 09:02:16 UTC
info of image used

image: docker.io/ansibleplaybookbundle/rhscl-mysql-apb:latest
# docker images
REPOSITORY                                                                                   TAG                 IMAGE ID            CREATED             SIZE
docker.io/ansibleplaybookbundle/rhscl-mysql-apb                                              latest              00c8b24bef26        9 hours ago         671.2 MB
docker.io/ansibleplaybookbundle/rhscl-mysql-apb                                              sprint139.1         00c8b24bef26        9 hours ago         671.2 MB

Comment 10 David Zager 2017-10-31 12:30:27 UTC
Good news: This isn't really a problem the mysql-apb can solve.
Bad news: This is a problem that impacts all of our APBs.

I'm still investigating the root cause and determining what a fix would look like. The ansible modules for kubernetes/openshift rely on their respective python clients which, as far as I can tell, are generated from the swagger specification. Using the python clients to delete deployment configs reproduces this behavior:

```
➜  openshift-restclient-python git:(add-dockerfile) docker run -it -v $HOME/.kube/config:/root/.kube/config:z openshift-rest python
Python 2.7.14 (default, Oct 10 2017, 02:49:49)
[GCC 4.9.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from openshift import client, config
>>>
>>> config.load_kube_config()
>>> api = client.OapiApi()
>>> api.delete_namespaced_deployment_config(name="hello-world", namespace="barproject", body="")                                                              
{'api_version': 'v1',
 'code': None,
 'details': None,
 'kind': 'DeploymentConfig',
 'message': None,
 'metadata': {'resource_version': '11197',
              'self_link': '/oapi/v1/namespaces/barproject/deploymentconfigs/hello-world'},
 'reason': None,
 'status': '{u\'replicas\': 1, u\'observedGeneration\': 1, u\'updatedReplicas\': 1, u\'availableReplicas\': 1, u\'details\': {u\'message\': u\'config change\', u\'causes\': [{u\'type\': u\'ConfigChange\'}]}, u\'latestVersion\': 1, u\'readyReplicas\': 1, u\'conditions\': [{u\'status\': u\'True\', u\'lastTransitionTime\': u\'2017-10-30T14:09:00Z\', u\'message\': u\'Deployment config has minimum availability.\', u\'type\': u\'Available\', u\'lastUpdateTime\': u\'2017-10-30T14:09:00Z\'}, {u\'status\': u\'True\', u\'lastUpdateTime\': u\'2017-10-30T14:09:02Z\', u\'lastTransitionTime\': u\'2017-10-30T14:09:02Z\', u\'reason\': u\'NewReplicationControllerAvailable\', u\'message\': u\'replication controller "hello-world-1" successfully rolled out\', u\'type\': u\'Progressing\'}], u\'unavailableReplicas\': 0}'}


➜  openshift-restclient-python git:(add-dockerfile) oc get all -n barproject
NAME                 HOST/PORT                                  PATH      SERVICES      PORT      TERMINATION   WILDCARD
routes/hello-world   hello-world-barproject.172.17.0.1.nip.io             hello-world   web                     None

NAME                     READY     STATUS    RESTARTS   AGE
po/hello-world-1-4hzbl   1/1       Running   0          46m

NAME               DESIRED   CURRENT   READY     AGE
rc/hello-world-1   1         1         1         47m

NAME              CLUSTER-IP      EXTERNAL-IP   PORT(S)    AGE
svc/hello-world   172.30.21.244   <none>        8080/TCP   47m
```

I must write bug(s)/issue(s) for the problem before resolving this one.

Comment 11 David Zager 2017-11-02 15:17:43 UTC
This bug will be fixed by Bug #1508969

Comment 12 David Zager 2017-11-02 15:30:57 UTC
After some internal discussion, it is more appropriate to mark this closed-duplicate as the bug is really in the python client that is not handling our request to delete the deployment(config) correctly.

*** This bug has been marked as a duplicate of bug 1508969 ***