• Kubernetes Submit Queue's avatar
    Merge pull request #43876 from caesarxuchao/blockOwnerDeletion-admission · 3b9eb1a8
    Kubernetes Submit Queue authored
    Automatic merge from submit-queue (batch tested with PRs 44440, 44038, 44302, 44316, 43876)
    
    Extend the gc admission plugin to check ownerReference.blockOwnerDeletion
    
    #Extend the gc admission plugin to prevent user who doesn't have delete permission of the *owner* from changing blockOwnerDeletion field of existing ownerReferences, or adding ownerReference with blockOwnerDeletion=true.
    
    The plugin need a RESTMapper to translate ownerRef.Kind to Resource. It should be using a dynamic one. However, as discussed in https://github.com/kubernetes/kubernetes/pull/42615, such a RESTMapper will be built after watchable discovery API is implemented, so in this PR the plugin is using the `api.Registry.RESTMapper()`, which is also [used](https://github.com/kubernetes/kubernetes/blob/master/cmd/kube-controller-manager/app/core.go#L165-L166) by the garbage collector currently.
    
    ```release-note
    Extending the gc admission plugin so that a user who doesn't have delete permission of the *owner* cannot modify blockOwnerDeletion field of existing ownerReferences, or add new ownerReference with blockOwnerDeletion=true
    ```
    
    cc @lavalamp
    3b9eb1a8
Name
Last commit
Last update
..
apis Loading commit data...
client Loading commit data...
cluster Loading commit data...
cmd Loading commit data...
deploy Loading commit data...
develop Loading commit data...
docs/api-reference Loading commit data...
manifests Loading commit data...
pkg Loading commit data...
registry/cluster Loading commit data...
BUILD Loading commit data...
Makefile Loading commit data...
OWNERS Loading commit data...
README.md Loading commit data...