webhook

package
v0.0.0-...-4eadfbb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 27, 2017 License: Apache-2.0, Apache-2.0 Imports: 28 Imported by: 0

Documentation

Overview

Package webhook delegates admission checks to dynamically configured webhooks.

Package webhook delegates admission checks to dynamically configured webhooks.

Package webhook checks a webhook for configured operation admission

Package webhook checks a webhook for configured operation admission

Package webhook checks a webhook for configured operation admission

Index

Constants

View Source
const (
	// Name of admission plug-in
	PluginName = "GenericAdmissionWebhook"
)

Variables

This section is empty.

Functions

func Register

func Register(plugins *admission.Plugins)

Register registers a plugin

Types

type AdmissionConfig

type AdmissionConfig struct {
	KubeConfigFile string `json:"kubeConfigFile"`
}

AdmissionConfig holds config data that is unique to each API server.

type AuthenticationInfoResolver

type AuthenticationInfoResolver interface {
	ClientConfigFor(server string) (*rest.Config, error)
}

type AuthenticationInfoResolverFunc

type AuthenticationInfoResolverFunc func(server string) (*rest.Config, error)

func (AuthenticationInfoResolverFunc) ClientConfigFor

func (a AuthenticationInfoResolverFunc) ClientConfigFor(server string) (*rest.Config, error)

type ErrCallingWebhook

type ErrCallingWebhook struct {
	WebhookName string
	Reason      error
}

func (*ErrCallingWebhook) Error

func (e *ErrCallingWebhook) Error() string

type GenericAdmissionWebhook

type GenericAdmissionWebhook struct {
	*admission.Handler
	// contains filtered or unexported fields
}

GenericAdmissionWebhook is an implementation of admission.Interface.

func NewGenericAdmissionWebhook

func NewGenericAdmissionWebhook(configFile io.Reader) (*GenericAdmissionWebhook, error)

NewGenericAdmissionWebhook returns a generic admission webhook plugin.

func (*GenericAdmissionWebhook) Admit

Admit makes an admission decision based on the request attributes.

func (*GenericAdmissionWebhook) SetAuthenticationInfoResolverWrapper

func (a *GenericAdmissionWebhook) SetAuthenticationInfoResolverWrapper(wrapper AuthenticationInfoResolverWrapper)

TODO find a better way wire this, but keep this pull small for now.

func (*GenericAdmissionWebhook) SetExternalKubeClientSet

func (a *GenericAdmissionWebhook) SetExternalKubeClientSet(client clientset.Interface)

func (*GenericAdmissionWebhook) SetScheme

func (a *GenericAdmissionWebhook) SetScheme(scheme *runtime.Scheme)

SetScheme sets a serializer(NegotiatedSerializer) which is derived from the scheme

func (*GenericAdmissionWebhook) SetServiceResolver

func (a *GenericAdmissionWebhook) SetServiceResolver(sr 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 (*GenericAdmissionWebhook) Validate

func (a *GenericAdmissionWebhook) Validate() error

type RuleMatcher

type RuleMatcher struct {
	Rule v1alpha1.RuleWithOperations
	Attr admission.Attributes
}

func (*RuleMatcher) Matches

func (r *RuleMatcher) Matches() bool

type ServiceResolver

type ServiceResolver interface {
	ResolveEndpoint(namespace, name string) (*url.URL, error)
}

serviceResolver knows how to convert a service reference into an actual location.

type WebhookSource

type WebhookSource interface {
	Run(stopCh <-chan struct{})
	ExternalAdmissionHooks() (*v1alpha1.ExternalAdmissionHookConfiguration, error)
}

WebhookSource can list dynamic webhook plugins.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL