Documentation
¶
Index ¶
- func ConvertToGVK(obj runtime.Object, gvk schema.GroupVersionKind, o admission.ObjectInterfaces) (runtime.Object, error)
- type Dispatcher
- type Source
- type VersionedAttributes
- type Webhook
- func (a *Webhook) Dispatch(attr admission.Attributes, o admission.ObjectInterfaces) error
- func (a *Webhook) SetAuthenticationInfoResolverWrapper(wrapper webhook.AuthenticationInfoResolverWrapper)
- func (a *Webhook) SetExternalKubeClientSet(client clientset.Interface)
- func (a *Webhook) SetExternalKubeInformerFactory(f informers.SharedInformerFactory)
- func (a *Webhook) SetServiceResolver(sr webhook.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 ¶
func ConvertToGVK ¶ added in v1.14.1
func ConvertToGVK(obj runtime.Object, gvk schema.GroupVersionKind, o admission.ObjectInterfaces) (runtime.Object, error)
ConvertToGVK converts object to the desired gvk.
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, o admission.ObjectInterfaces, 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, o admission.ObjectInterfaces) error
Dispatch is called by the downstream Validate or Admit methods.
func (*Webhook) SetAuthenticationInfoResolverWrapper ¶
func (a *Webhook) SetAuthenticationInfoResolverWrapper(wrapper webhook.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) SetServiceResolver ¶
func (a *Webhook) SetServiceResolver(sr webhook.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.