Documentation ¶
Index ¶
- type Dispatcher
- type Source
- type VersionedAttributes
- type Webhook
- func (a *Webhook) Dispatch(attr admission.Attributes) error
- func (a *Webhook) SetAuthenticationInfoResolverWrapper(wrapper config.AuthenticationInfoResolverWrapper)
- func (a *Webhook) SetExternalKubeClientSet(client clientset.Interface)
- func (a *Webhook) SetExternalKubeInformerFactory(f informers.SharedInformerFactory)
- func (a *Webhook) SetScheme(scheme *runtime.Scheme)
- func (a *Webhook) SetServiceResolver(sr config.ServiceResolver)
- func (a *Webhook) ShouldCallHook(h *v1beta1.Webhook, attr admission.Attributes) (bool, *apierrors.StatusError)
- func (a *Webhook) ValidateInitialization() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Dispatcher ¶
type Dispatcher interface { // Dispatch a request to the webhooks using the given webhooks. A non-nil error means the request is rejected. Dispatch(ctx context.Context, a *VersionedAttributes, hooks []*v1beta1.Webhook) error }
Dispatcher dispatches webhook call to a list of webhooks with admission attributes as argument.
type VersionedAttributes ¶
type VersionedAttributes struct { admission.Attributes VersionedOldObject runtime.Object VersionedObject runtime.Object }
VersionedAttributes is a wrapper around the original admission attributes, adding versioned variants of the object and old object.
type Webhook ¶
Webhook is an abstract admission plugin with all the infrastructure to define Admit or Validate on-top.
func NewWebhook ¶
func NewWebhook(handler *admission.Handler, configFile io.Reader, sourceFactory sourceFactory, dispatcherFactory dispatcherFactory) (*Webhook, error)
NewWebhook creates a new generic admission webhook.
func (*Webhook) Dispatch ¶
func (a *Webhook) Dispatch(attr admission.Attributes) error
Dispatch is called by the downstream Validate or Admit methods.
func (*Webhook) SetAuthenticationInfoResolverWrapper ¶
func (a *Webhook) SetAuthenticationInfoResolverWrapper(wrapper config.AuthenticationInfoResolverWrapper)
SetAuthenticationInfoResolverWrapper sets the AuthenticationInfoResolverWrapper. TODO find a better way wire this, but keep this pull small for now.
func (*Webhook) SetExternalKubeClientSet ¶
SetExternalKubeClientSet implements the WantsExternalKubeInformerFactory interface. It sets external ClientSet for admission plugins that need it
func (*Webhook) SetExternalKubeInformerFactory ¶
func (a *Webhook) SetExternalKubeInformerFactory(f informers.SharedInformerFactory)
SetExternalKubeInformerFactory implements the WantsExternalKubeInformerFactory interface.
func (*Webhook) SetScheme ¶
SetScheme sets a serializer(NegotiatedSerializer) which is derived from the scheme
func (*Webhook) SetServiceResolver ¶
func (a *Webhook) SetServiceResolver(sr config.ServiceResolver)
SetServiceResolver sets a service resolver for the webhook admission plugin. Passing a nil resolver does not have an effect, instead a default one will be used.
func (*Webhook) ShouldCallHook ¶
func (a *Webhook) ShouldCallHook(h *v1beta1.Webhook, attr admission.Attributes) (bool, *apierrors.StatusError)
ShouldCallHook makes a decision on whether to call the webhook or not by the attribute.
func (*Webhook) ValidateInitialization ¶
ValidateInitialization implements the InitializationValidator interface.