mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-20 01:23:48 +00:00
Update admission initializers.
Moved RestMapper and add DynamicClient
This commit is contained in:
@@ -30,11 +30,6 @@ type WantsCloudConfig interface {
|
||||
SetCloudConfig([]byte)
|
||||
}
|
||||
|
||||
// WantsRESTMapper defines a function which sets RESTMapper for admission plugins that need it.
|
||||
type WantsRESTMapper interface {
|
||||
SetRESTMapper(meta.RESTMapper)
|
||||
}
|
||||
|
||||
// PluginInitializer is used for initialization of the Kubernetes specific admission plugins.
|
||||
type PluginInitializer struct {
|
||||
cloudConfig []byte
|
||||
@@ -66,7 +61,7 @@ func (i *PluginInitializer) Initialize(plugin admission.Interface) {
|
||||
wants.SetCloudConfig(i.cloudConfig)
|
||||
}
|
||||
|
||||
if wants, ok := plugin.(WantsRESTMapper); ok {
|
||||
if wants, ok := plugin.(initializer.WantsRESTMapper); ok {
|
||||
wants.SetRESTMapper(i.restMapper)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user