kubernetes/pkg/controller
Kubernetes Submit Queue 6a28658ca1 Merge pull request #44058 from caesarxuchao/background-cascading
Automatic merge from submit-queue (batch tested with PRs 44058, 48085, 48077, 48076, 47823)

Make background garbage collection cascading

Fix #44046, fix #47843 where user reported that the garbage collector didn't delete pods when a deployment was deleted with PropagationPolicy=Background.

The cause is that when propagating background garbage collection request, the garbage collector deletes dependents with DeleteOptions.PropagationPolicy=nil, which means the default GC policy of a resource (defined by its REST strategy) and the existing GC-related finalizers will decide how the delete request is propagated further. Unfortunately, the default GC policy for RS is orphaning, so the pods are behind when a deployment is deleted.

This PR changes the garbage collector to delete dependents with DeleteOptions.PropagationPolicy=Background when the owner is deleted in background. This means the dependent's existing GC finalizers will be overridden, making orphaning less flexible (see this made-up [case](https://github.com/kubernetes/kubeadm/issues/149#issuecomment-278942012)). I think sacrificing the flexibility of orphaning is worthwhile, because making the behavior of background garbage collection matching users' expectation is more important.

cc @lavalamp @kargakis @krmayankk @enisoc 

```release-note
The garbage collector now cascades deletion properly when deleting an object with propagationPolicy="background". This resolves issue [#44046](https://github.com/kubernetes/kubernetes/issues/44046), so that when a deployment is deleted with propagationPolicy="background", the garbage collector ensures dependent pods are deleted as well.
```
2017-06-26 15:29:25 -07:00
..
bootstrap run hack/update-all 2017-06-22 11:31:03 -07:00
certificates run hack/update-all 2017-06-22 11:31:03 -07:00
cloud run hack/update-all 2017-06-22 11:31:03 -07:00
cronjob deprecate created-by annotation for cronjob 2017-06-23 11:05:40 -07:00
daemon run hack/update-all 2017-06-22 11:31:03 -07:00
deployment revert 45764 2017-06-25 21:41:10 -07:00
disruption run hack/update-all 2017-06-22 11:31:03 -07:00
endpoint Retry service syncs with exponential backoff in endpoints-controller 2017-06-26 13:35:46 +02:00
garbagecollector garbage collector controller propagates DeletePropagationForeground 2017-06-26 09:53:03 -07:00
history Merge pull request #47709 from krmayankk/ss 2017-06-23 07:21:33 -07:00
job run hack/update-all 2017-06-22 11:31:03 -07:00
namespace run hack/update-all 2017-06-22 11:31:03 -07:00
node Merge pull request #46955 from zjj2wry/nodecontroller_matrics 2017-06-23 22:22:16 -07:00
podautoscaler run hack/update-all 2017-06-22 11:31:03 -07:00
podgc run hack/update-all 2017-06-22 11:31:03 -07:00
replicaset run hack/update-all 2017-06-22 11:31:03 -07:00
replication run hack/update-all 2017-06-22 11:31:03 -07:00
resourcequota run hack/update-all 2017-06-22 11:31:03 -07:00
route run hack/update-all 2017-06-22 11:31:03 -07:00
service run hack/update-all 2017-06-22 11:31:03 -07:00
serviceaccount run hack/update-all 2017-06-22 11:31:03 -07:00
statefulset Merge pull request #47772 from jianglingxia/jlx620 2017-06-23 08:29:26 -07:00
ttl run hack/update-all 2017-06-22 11:31:03 -07:00
volume Merge pull request #42254 from justinsb/volumes_dont_leak_nodestatusupdateneeded 2017-06-22 21:43:04 -07:00
.import-restrictions add import restrictions 2016-10-13 16:10:24 -07:00
BUILD run hack/update-all 2017-06-22 11:31:03 -07:00
client_builder.go run hack/update-all 2017-06-22 11:31:03 -07:00
controller_ref_manager.go revert 45764 2017-06-25 21:41:10 -07:00
controller_ref_manager_test.go run hack/update-all 2017-06-22 11:31:03 -07:00
controller_utils.go run hack/update-all 2017-06-22 11:31:03 -07:00
controller_utils_test.go run hack/update-all 2017-06-22 11:31:03 -07:00
doc.go Use Go canonical import paths 2016-07-16 13:48:21 -04:00
lookup_cache.go Use fnv.New32a() in hash instead adler32 2017-02-15 14:03:54 +08:00
OWNERS Add janetkuo to approvers for controllers 2017-02-08 14:37:25 -08:00