Merge pull request #52618 from dims/deprecate-pvl-admission-controller

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>..

deprecate warning for persistent volume admission controller

**What this PR does / why we need it**:

deprecate warning for persistent volume admission controller

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #

Fixes #52617

**Special notes for your reviewer**:

**Release note**:

```release-note
PersistentVolumeLabel admission controller is now deprecated.
```
This commit is contained in:
Kubernetes Submit Queue 2017-09-21 22:04:55 -07:00 committed by GitHub
commit 04673ab614
3 changed files with 8 additions and 1 deletions

View File

@ -71,7 +71,7 @@ func RegisterAllAdmissionPlugins(plugins *admission.Plugins) {
autoprovision.Register(plugins)
exists.Register(plugins)
noderestriction.Register(plugins)
label.Register(plugins)
label.Register(plugins) // DEPRECATED in favor of NewPersistentVolumeLabelController in CCM
podnodeselector.Register(plugins)
podpreset.Register(plugins)
podtolerationrestriction.Register(plugins)

View File

@ -20,6 +20,7 @@ go_library(
"//pkg/kubeapiserver/admission:go_default_library",
"//pkg/kubelet/apis:go_default_library",
"//pkg/volume:go_default_library",
"//vendor/github.com/golang/glog:go_default_library",
"//vendor/k8s.io/apiserver/pkg/admission:go_default_library",
],
)

View File

@ -22,6 +22,7 @@ import (
"io"
"sync"
"github.com/golang/glog"
"k8s.io/apiserver/pkg/admission"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/cloudprovider"
@ -58,6 +59,11 @@ var _ kubeapiserveradmission.WantsCloudConfig = &persistentVolumeLabel{}
//
// As a side effect, the cloud provider may block invalid or non-existent volumes.
func NewPersistentVolumeLabel() *persistentVolumeLabel {
// DEPRECATED: cloud-controller-manager will now start NewPersistentVolumeLabelController
// which does exactly what this admission controller used to do. So once GCE and AWS can
// run externally, we can remove this admission controller.
glog.Warning("PersistentVolumeLabel admission controller is deprecated. " +
"Please remove this controller from your configuration files and scripts.")
return &persistentVolumeLabel{
Handler: admission.NewHandler(admission.Create),
}