mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-12 05:21:58 +00:00
Remove FG inspection from VAP plugin
This commit is contained in:
parent
0f19faf9be
commit
72ad9c5fdf
@ -36,7 +36,6 @@ import (
|
|||||||
"k8s.io/client-go/dynamic"
|
"k8s.io/client-go/dynamic"
|
||||||
"k8s.io/client-go/informers"
|
"k8s.io/client-go/informers"
|
||||||
"k8s.io/client-go/kubernetes"
|
"k8s.io/client-go/kubernetes"
|
||||||
"k8s.io/component-base/featuregate"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@ -93,13 +92,12 @@ type Plugin struct {
|
|||||||
|
|
||||||
var _ admission.Interface = &Plugin{}
|
var _ admission.Interface = &Plugin{}
|
||||||
var _ admission.ValidationInterface = &Plugin{}
|
var _ admission.ValidationInterface = &Plugin{}
|
||||||
var _ initializer.WantsFeatures = &Plugin{}
|
|
||||||
var _ initializer.WantsExcludedAdmissionResources = &Plugin{}
|
var _ initializer.WantsExcludedAdmissionResources = &Plugin{}
|
||||||
|
|
||||||
func NewPlugin(_ io.Reader) *Plugin {
|
func NewPlugin(_ io.Reader) *Plugin {
|
||||||
handler := admission.NewHandler(admission.Connect, admission.Create, admission.Delete, admission.Update)
|
handler := admission.NewHandler(admission.Connect, admission.Create, admission.Delete, admission.Update)
|
||||||
|
|
||||||
return &Plugin{
|
p := &Plugin{
|
||||||
Plugin: generic.NewPlugin(
|
Plugin: generic.NewPlugin(
|
||||||
handler,
|
handler,
|
||||||
func(f informers.SharedInformerFactory, client kubernetes.Interface, dynamicClient dynamic.Interface, restMapper meta.RESTMapper) generic.Source[PolicyHook] {
|
func(f informers.SharedInformerFactory, client kubernetes.Interface, dynamicClient dynamic.Interface, restMapper meta.RESTMapper) generic.Source[PolicyHook] {
|
||||||
@ -119,6 +117,8 @@ func NewPlugin(_ io.Reader) *Plugin {
|
|||||||
},
|
},
|
||||||
),
|
),
|
||||||
}
|
}
|
||||||
|
p.SetEnabled(true)
|
||||||
|
return p
|
||||||
}
|
}
|
||||||
|
|
||||||
// Validate makes an admission decision based on the request attributes.
|
// Validate makes an admission decision based on the request attributes.
|
||||||
@ -126,10 +126,6 @@ func (a *Plugin) Validate(ctx context.Context, attr admission.Attributes, o admi
|
|||||||
return a.Plugin.Dispatch(ctx, attr, o)
|
return a.Plugin.Dispatch(ctx, attr, o)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *Plugin) InspectFeatureGates(featureGates featuregate.FeatureGate) {
|
|
||||||
a.Plugin.SetEnabled(true)
|
|
||||||
}
|
|
||||||
|
|
||||||
func compilePolicy(policy *Policy) Validator {
|
func compilePolicy(policy *Policy) Validator {
|
||||||
hasParam := false
|
hasParam := false
|
||||||
if policy.Spec.ParamKind != nil {
|
if policy.Spec.ParamKind != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user