Documentation ¶
Index ¶
- Constants
- func Register(plugins *admission.Plugins)
- type PSPMatchFn
- type PodSecurityPolicyPlugin
- func (c *PodSecurityPolicyPlugin) Admit(a admission.Attributes) error
- func (plugin *PodSecurityPolicyPlugin) SetAuthorizer(authz authorizer.Authorizer)
- func (a *PodSecurityPolicyPlugin) SetInternalKubeInformerFactory(f informers.SharedInformerFactory)
- func (c *PodSecurityPolicyPlugin) Validate(a admission.Attributes) error
- func (plugin *PodSecurityPolicyPlugin) ValidateInitialization() error
Constants ¶
View Source
const (
PluginName = "PodSecurityPolicy"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type PSPMatchFn ¶
type PSPMatchFn func(lister extensionslisters.PodSecurityPolicyLister, user user.Info, sa user.Info, authz authorizer.Authorizer, namespace string) ([]*extensions.PodSecurityPolicy, error)
PSPMatchFn allows plugging in how PSPs are matched against user information.
type PodSecurityPolicyPlugin ¶ added in v1.9.0
type PodSecurityPolicyPlugin struct { *admission.Handler // contains filtered or unexported fields }
PodSecurityPolicyPlugin holds state for and implements the admission plugin.
func NewPlugin ¶
func NewPlugin(strategyFactory psp.StrategyFactory, pspMatcher PSPMatchFn, failOnNoPolicies bool) *PodSecurityPolicyPlugin
NewPlugin creates a new PSP admission plugin.
func (*PodSecurityPolicyPlugin) Admit ¶ added in v1.9.0
func (c *PodSecurityPolicyPlugin) Admit(a admission.Attributes) error
Admit determines if the pod should be admitted based on the requested security context and the available PSPs.
- Find available PSPs.
- Create the providers, includes setting pre-allocated values if necessary.
- Try to generate and validate a PSP with providers. If we find one then admit the pod with the validated PSP. If we don't find any reject the pod and give all errors from the failed attempts.
func (*PodSecurityPolicyPlugin) SetAuthorizer ¶ added in v1.9.0
func (plugin *PodSecurityPolicyPlugin) SetAuthorizer(authz authorizer.Authorizer)
SetAuthorizer sets the authorizer.
func (*PodSecurityPolicyPlugin) SetInternalKubeInformerFactory ¶ added in v1.9.0
func (a *PodSecurityPolicyPlugin) SetInternalKubeInformerFactory(f informers.SharedInformerFactory)
func (*PodSecurityPolicyPlugin) Validate ¶ added in v1.9.0
func (c *PodSecurityPolicyPlugin) Validate(a admission.Attributes) error
func (*PodSecurityPolicyPlugin) ValidateInitialization ¶ added in v1.9.0
func (plugin *PodSecurityPolicyPlugin) ValidateInitialization() error
ValidateInitialization ensures an authorizer is set.
Click to show internal directories.
Click to hide internal directories.