Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1623352

Summary: Orphan propagationPolicy work as Background propagationPolicy for daemonset
Product: OpenShift Container Platform Reporter: weiwei jiang <wjiang>
Component: ocAssignee: Maciej Szulik <maszulik>
Status: CLOSED CURRENTRELEASE QA Contact: Xingxing Xia <xxia>
Severity: medium Docs Contact:
Priority: medium    
Version: 3.11.0CC: aos-bugs, jokerman, mmccomas, tnozicka
Target Milestone: ---   
Target Release: 3.11.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Cause: oc delete was not looking at propagation policy when removing Daemon Set. Consequence: Deleting DaemonSet with propagation policy set to orphan resulted in Pods being also removed. Fix: Consider the value of propagation policy set during DaemonSet removal. Result: Pods are not cleaned when propagation policy is set to orphan, when deleting DaemonSet.
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-12-21 15:23:17 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 weiwei jiang 2018-08-29 07:44:18 UTC
Description of problem:
When I try to delete daemonset with `--cascade=false`, the request payload is Orphan propagationPolicy
I0829 02:25:52.851509   56380 request.go:897] Request Body: {"propagationPolicy":"Orphan"}    
I0829 02:25:52.851558   56380 round_trippers.go:383] DELETE https://qe-wjiang-master-etcd-1:8443/apis/extensions/v1beta1/namespaces/default/daemonsets/hello-daemonset

But all pods with ownerReference to this daemonset will be cleaned.

Version-Release number of selected component (if applicable):
# oc version 
oc v3.11.0-0.24.0
kubernetes v1.11.0+d4cacc0
features: Basic-Auth GSSAPI Kerberos SPNEGO

Server https://qe-wjiang-master-etcd-1:8443
openshift v3.11.0-0.24.0
kubernetes v1.11.0+d4cacc0


How reproducible:
Always

Steps to Reproduce:
1. Create a daemonset
oc create -f https://raw.githubusercontent.com/openshift-qe/v3-testfiles/master/daemon/daemonset.yaml
2. Wait the daemonset ready, and delete the daemonset with `--cascade=false`
3. Check if the pods will be deleted

Actual results:
3. All pods will be cleaned

Expected results:
3. All pods should not be deleted.

Additional info:

Comment 1 Tomáš Nožička 2018-08-29 12:53:35 UTC
I have traced it to:

https://github.com/kubernetes/kubernetes/pull/64847/files#diff-7c126b9106a83157d89a336103eb3dbbR314

we just likely need another hack, if cascade=false, to avoid calling this hack :)

Comment 2 Maciej Szulik 2018-08-29 13:19:13 UTC
Fix in https://github.com/openshift/origin/pull/20793

Comment 3 openshift-github-bot 2018-08-30 10:01:55 UTC
Commit pushed to master at https://github.com/openshift/origin

https://github.com/openshift/origin/commit/5686cdc2f4224838295f49e7cc7361c5f3b00052
Merge pull request #20793 from soltysh/bug1623352

UPSTREAM: 68007: Orphan DaemonSet when deleting with --cascade option set

Comment 4 weiwei jiang 2018-08-31 03:06:32 UTC
Waitting new puddle to have a try.

Comment 5 weiwei jiang 2018-09-06 07:28:43 UTC
Checked with 
# oc version
oc v3.11.0-0.28.0
kubernetes v1.11.0+d4cacc0
features: Basic-Auth GSSAPI Kerberos SPNEGO

Server https://ip-172-18-7-85.ec2.internal:8443
openshift v3.11.0-0.28.0
kubernetes v1.11.0+d4cacc0

And this issue has been fixed.

Comment 6 Luke Meyer 2018-12-21 15:23:17 UTC
Closing bugs that were verified and targeted for GA but for some reason were not picked up by errata. This bug fix should be present in current 3.11 release content.