Bug 1609716

Summary: etcd operator can't be deleted
Product: OpenShift Container Platform Reporter: ge liu <geliu>
Component: EtcdAssignee: Sebastien Pahl <spahl>
Status: CLOSED ERRATA QA Contact: ge liu <geliu>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 3.11.0CC: dma, ecordell
Target Milestone: ---   
Target Release: 3.11.0   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-10-11 07:22:47 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:

Description ge liu 2018-07-30 08:52:03 UTC
Description of problem:
as title, delete subscription of etcd-operator, and the etcd-operator pods still exist in the project, it should be deleted.

ocp version: v3.11.0-0.10.0

How reproducible:
Always

Steps to Reproduce:
1. create subscription for etcd-operator 

apiVersion: app.coreos.com/v1alpha1
kind: Subscription-v1
metadata:
  name: etcd-test
  namespace: operator-lifecycle-manager
spec:
  channel: alpha
  name: etcd
  source: tectonic-ocs

2. After run some testcase, delete all etcd-operator stuff, then delete subscription:

#oc  delete endpoints etcd-operator
#oc  delete crd etcdclusters.etcd.database.coreos.com
#oc delete crd etcdbackups.etcd.database.coreos.com     
#oc  delete crd etcdrestores.etcd.database.coreos.com  

# oc delete -f etcd-subscription.yaml
subscription-v1.app.coreos.com "etcd-test" deleted

# oc delete pods etcd-operator-7b49974f5b-vnkqw

3. check the etcd-operator still exist

# oc get pods
NAME                                READY     STATUS    RESTARTS   AGE
alm-operator-657669cf6-g68p2        1/1       Running   0          7h
catalog-operator-5d7b55dc89-67qww   1/1       Running   0          7h
etcd-operator-7b49974f5b-vnkqw      3/3       Running   0          20m



Actual results:

Delete subscription, then delete etcd-pods, but pod still be rescheduled 

as title

Expected results:
Delete subscription, then delete etcd-pods, etcd-operator should non-exist

Comment 1 Evan Cordell 2018-08-22 15:29:21 UTC
The etcd operator should not be deleted when the subscription is deleted.

Deleting the etcd subscription is telling OLM "stop updating the etcd operator".

To actually delete the etcd operator you can remove the ClusterServiceVersion for the etcd operator that was created by OLM due to the subscription. The etcd operator deployment has ownerreferences pointing to the ClusterServiceVersion and should be GC'd by openshift shortly after deleting the etcdoperator ClusterServiceVersion.

Comment 2 ge liu 2018-08-23 09:38:42 UTC
@ecordell, yes, thanks for your kindly explanation, and I suppose these points will be recorded in doc later, because customer will puzzled about it also.

and I tried to delete etcd-operator ClusterServiceVersion by command line, then the etcd operator pod really be deleted right now, but I tried to do this operation on admin console ui, it looks like there is not DELETE action in: Operators-->Cluster Service Versions-->Open Cloud Services-->etcd, there is only one action:Edit application Definition, I tried to delete etcd subscription successfully, but the etcd ClusterServiceVersion still exist, so is it a UI bug? thanks!

Comment 4 errata-xmlrpc 2018-10-11 07:22:47 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:2652