mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-03 17:30:00 +00:00
Add versioned API for AdmissionConfiguration
This commit is contained in:
parent
1854d48238
commit
b061c20e0a
@ -48,6 +48,7 @@ func addKnownTypes(scheme *runtime.Scheme) error {
|
||||
&KubeProxyConfiguration{},
|
||||
&KubeSchedulerConfiguration{},
|
||||
&KubeletConfiguration{},
|
||||
&AdmissionConfiguration{},
|
||||
)
|
||||
return nil
|
||||
}
|
||||
@ -55,3 +56,4 @@ func addKnownTypes(scheme *runtime.Scheme) error {
|
||||
func (obj *KubeProxyConfiguration) GetObjectKind() schema.ObjectKind { return &obj.TypeMeta }
|
||||
func (obj *KubeSchedulerConfiguration) GetObjectKind() schema.ObjectKind { return &obj.TypeMeta }
|
||||
func (obj *KubeletConfiguration) GetObjectKind() schema.ObjectKind { return &obj.TypeMeta }
|
||||
func (obj *AdmissionConfiguration) GetObjectKind() schema.ObjectKind { return &obj.TypeMeta }
|
||||
|
@ -18,6 +18,7 @@ package componentconfig
|
||||
|
||||
import (
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
utilconfig "k8s.io/kubernetes/pkg/util/config"
|
||||
)
|
||||
@ -828,3 +829,28 @@ type PersistentVolumeRecyclerConfiguration struct {
|
||||
// in a multi-node cluster.
|
||||
IncrementTimeoutHostPath int32
|
||||
}
|
||||
|
||||
// AdmissionConfiguration provides versioned configuration for admission controllers.
|
||||
type AdmissionConfiguration struct {
|
||||
metav1.TypeMeta
|
||||
|
||||
// Plugins allows specifying a configuration per admission control plugin.
|
||||
Plugins []AdmissionPluginConfiguration
|
||||
}
|
||||
|
||||
// AdmissionPluginConfiguration provides the configuration for a single plug-in.
|
||||
type AdmissionPluginConfiguration struct {
|
||||
// Name is the name of the admission controller.
|
||||
// It must match the registered admission plugin name.
|
||||
Name string
|
||||
|
||||
// Path is the path to a configuration file that contains the plugin's
|
||||
// configuration
|
||||
// +optional
|
||||
Path string
|
||||
|
||||
// Configuration is an embedded configuration object to be used as the plugin's
|
||||
// configuration. If present, it will be used instead of the path to the configuration file.
|
||||
// +optional
|
||||
Configuration runtime.Object
|
||||
}
|
||||
|
@ -37,6 +37,7 @@ func addKnownTypes(scheme *runtime.Scheme) error {
|
||||
&KubeProxyConfiguration{},
|
||||
&KubeSchedulerConfiguration{},
|
||||
&KubeletConfiguration{},
|
||||
&AdmissionConfiguration{},
|
||||
)
|
||||
return nil
|
||||
}
|
||||
@ -44,3 +45,4 @@ func addKnownTypes(scheme *runtime.Scheme) error {
|
||||
func (obj *KubeProxyConfiguration) GetObjectKind() schema.ObjectKind { return &obj.TypeMeta }
|
||||
func (obj *KubeSchedulerConfiguration) GetObjectKind() schema.ObjectKind { return &obj.TypeMeta }
|
||||
func (obj *KubeletConfiguration) GetObjectKind() schema.ObjectKind { return &obj.TypeMeta }
|
||||
func (obj *AdmissionConfiguration) GetObjectKind() schema.ObjectKind { return &obj.TypeMeta }
|
||||
|
@ -18,6 +18,7 @@ package v1alpha1
|
||||
|
||||
import (
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/kubernetes/pkg/api/v1"
|
||||
)
|
||||
|
||||
@ -578,3 +579,29 @@ type KubeletAnonymousAuthentication struct {
|
||||
// Anonymous requests have a username of system:anonymous, and a group name of system:unauthenticated.
|
||||
Enabled *bool `json:"enabled"`
|
||||
}
|
||||
|
||||
// AdmissionConfiguration provides versioned configuration for admission controllers.
|
||||
type AdmissionConfiguration struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
|
||||
// Plugins allows specifying a configuration per admission control plugin.
|
||||
// +optional
|
||||
Plugins []AdmissionPluginConfiguration `json:"plugins"`
|
||||
}
|
||||
|
||||
// AdmissionPluginConfiguration provides the configuration for a single plug-in.
|
||||
type AdmissionPluginConfiguration struct {
|
||||
// Name is the name of the admission controller.
|
||||
// It must match the registered admission plugin name.
|
||||
Name string `json:"name"`
|
||||
|
||||
// Path is the path to a configuration file that contains the plugin's
|
||||
// configuration
|
||||
// +optional
|
||||
Path string `json:"path"`
|
||||
|
||||
// Configuration is an embedded configuration object to be used as the plugin's
|
||||
// configuration. If present, it will be used instead of the path to the configuration file.
|
||||
// +optional
|
||||
Configuration runtime.RawExtension `json:"configuration"`
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user