kubernetes/pkg/controller/volume/persistentvolume
Kubernetes Submit Queue 5cecc6ec68
Merge pull request #59350 from jsafrane/recycler-wait
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Do not recycle volumes that are used by pods

**What this PR does / why we need it**:
Recycler should wait until all pods that use a volume are finished.

Consider this scenario:

1. User creates a PVC that's bound to a NFS PV.
2. User creates a pod that uses the PVC
3. User deletes the PVC.

Now the PV gets `Released` (the PVC does not exists) and recycled, however the PV is still mounted to a running pod. PVC protection won't help us, because it puts finalizers on PVC that is under user's control and user can remove it.

This PR checks that there is no pod that uses a PV before it recycles it.

**Release note**:

```release-note
NONE
```

/sig storage
2018-02-07 10:01:32 -08:00
..
metrics add number measurement for bound/unbound pv/pvc 2018-01-11 10:07:20 +08:00
options update BUILD files 2017-10-15 18:18:13 -07:00
binder_test.go Pass pod informer to PV controller 2018-02-05 15:40:25 +01:00
BUILD Merge pull request #59350 from jsafrane/recycler-wait 2018-02-07 10:01:32 -08:00
delete_test.go Pass pod informer to PV controller 2018-02-05 15:40:25 +01:00
framework_test.go Pass pod informer to PV controller 2018-02-05 15:40:25 +01:00
index.go existing PV controller changes 2018-01-31 20:02:01 +08:00
index_test.go existing PV controller changes 2018-01-31 20:02:01 +08:00
OWNERS Update OWNERS approvers and reviewers: pkg/controller 2016-11-02 16:19:18 -07:00
provision_test.go Pass pod informer to PV controller 2018-02-05 15:40:25 +01:00
pv_controller.go Don't recycle PVs that are used by a pod 2018-02-05 16:41:39 +01:00
pv_controller_base.go Merge pull request #59350 from jsafrane/recycler-wait 2018-02-07 10:01:32 -08:00
pv_controller_test.go In findMatchingVolumes: 2017-11-21 21:42:35 -08:00
recycle_test.go Don't recycle PVs that are used by a pod 2018-02-05 16:41:39 +01:00
scheduler_assume_cache.go Add assume cache for PVs 2017-11-21 21:42:35 -08:00
scheduler_assume_cache_test.go Add assume cache for PVs 2017-11-21 21:42:35 -08:00
scheduler_binder.go Library for scheduler volume binding 2017-11-21 21:42:36 -08:00
scheduler_binder_cache.go Cache for pod bindings 2017-11-21 21:42:36 -08:00
scheduler_binder_cache_test.go Cache for pod bindings 2017-11-21 21:42:36 -08:00
scheduler_binder_fake.go Library for scheduler volume binding 2017-11-21 21:42:36 -08:00
scheduler_binder_test.go Library for scheduler volume binding 2017-11-21 21:42:36 -08:00
volume_host.go VolumeHost.GetNodeName method added for CSI fix 2017-12-02 05:54:54 -05:00