Documentation ¶
Index ¶
- type Builder
- func (blder *Builder) Complete(i interface{}) error
- func (blder *Builder) For(apiType runtime.Object) *Builder
- func (blder *Builder) WithMutatePath(path string) *Builder
- func (blder *Builder) WithMutatePrefix(prefix string) *Builder
- func (blder *Builder) WithValidatePath(path string) *Builder
- func (blder *Builder) WithValidatePrefix(prefix string) *Builder
- type ClientInjector
- type DecoderInjector
- type InjectedClient
- type InjectedDecoder
- type MutateFunc
- type MutatingWebhook
- type Mutator
- type ValidateFuncs
- func (v *ValidateFuncs) ValidateCreate(ctx context.Context, req admission.Request, obj runtime.Object) admission.Response
- func (v *ValidateFuncs) ValidateDelete(ctx context.Context, req admission.Request, obj runtime.Object) admission.Response
- func (v *ValidateFuncs) ValidateUpdate(ctx context.Context, req admission.Request, new runtime.Object, ...) admission.Response
- type ValidatingWebhook
- func (v *ValidatingWebhook) ValidateCreate(_ context.Context, _ admission.Request, _ runtime.Object) admission.Response
- func (v *ValidatingWebhook) ValidateDelete(_ context.Context, _ admission.Request, _ runtime.Object) admission.Response
- func (v *ValidatingWebhook) ValidateUpdate(_ context.Context, _ admission.Request, _ runtime.Object, _ runtime.Object) admission.Response
- type Validator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
Builder builds a Webhook.
func NewGenericWebhookManagedBy ¶
NewGenericWebhookManagedBy returns a new webhook Builder that will be invoked by the provided manager.Manager.
func (*Builder) Complete ¶
Complete builds the webhook. If the given object implements the Mutator interface, a MutatingWebhook will be created. If the given object implements the Validator interface, a ValidatingWebhook will be created.
func (*Builder) WithMutatePath ¶ added in v1.0.1
WithMutatePath overrides the mutate path of the webhook
func (*Builder) WithMutatePrefix ¶ added in v1.0.1
WithMutatePrefix sets a custom prefix for the mutate path of the webhook, default is '/mutate-'
func (*Builder) WithValidatePath ¶ added in v1.0.1
WithValidatePath overrides the validate path of the webhook
func (*Builder) WithValidatePrefix ¶ added in v1.0.1
WithValidatePrefix sets a custom prefix for the validate path of the webhook, default is '/validate-'
type ClientInjector ¶ added in v1.5.1
ClientInjector is used to inject a client.Client into webhook handlers.
type DecoderInjector ¶ added in v1.5.1
DecoderInjector is used to inject an admission.Decoder into webhook handlers.
type InjectedClient ¶ added in v1.1.0
InjectedClient holds an injected client.Client
func (*InjectedClient) InjectClient ¶ added in v1.1.0
func (i *InjectedClient) InjectClient(client client.Client) error
InjectClient implements the ClientInjector interface.
type InjectedDecoder ¶ added in v1.1.0
InjectedDecoder holds an injected admission.Decoder
func (*InjectedDecoder) InjectDecoder ¶ added in v1.1.0
func (i *InjectedDecoder) InjectDecoder(decoder admission.Decoder) error
InjectDecoder implements the DecoderInjector interface.
type MutateFunc ¶
type MutateFunc struct { MutatingWebhook Func func(context.Context, admission.Request, runtime.Object) admission.Response }
MutateFunc is a functional interface for a generic mutating admission webhook.
type MutatingWebhook ¶
type MutatingWebhook struct { InjectedClient InjectedDecoder }
MutatingWebhook is a generic mutating admission webhook.
type Mutator ¶
type Mutator interface { // Mutate yields a response to a mutating AdmissionRequest. Mutate(ctx context.Context, req admission.Request, obj runtime.Object) admission.Response }
Mutator specifies the interface for a generic mutating webhook.
type ValidateFuncs ¶
type ValidateFuncs struct { ValidatingWebhook CreateFunc func(context.Context, admission.Request, runtime.Object) admission.Response UpdateFunc func(context.Context, admission.Request, runtime.Object, runtime.Object) admission.Response DeleteFunc func(context.Context, admission.Request, runtime.Object) admission.Response }
ValidateFuncs is a functional interface for a generic validating admission webhook.
func (*ValidateFuncs) ValidateCreate ¶
func (v *ValidateFuncs) ValidateCreate(ctx context.Context, req admission.Request, obj runtime.Object) admission.Response
ValidateCreate implements the Validator interface by calling the CreateFunc.
type ValidatingWebhook ¶
type ValidatingWebhook struct { InjectedClient InjectedDecoder }
ValidatingWebhook is a generic validating admission webhook.
func (*ValidatingWebhook) ValidateCreate ¶
func (v *ValidatingWebhook) ValidateCreate(_ context.Context, _ admission.Request, _ runtime.Object) admission.Response
ValidateCreate implements the Validator interface.
type Validator ¶
type Validator interface { // ValidateCreate yields a response to a validating AdmissionRequest with operation set to Create. ValidateCreate(ctx context.Context, req admission.Request, obj runtime.Object) admission.Response // ValidateUpdate yields a response to a validating AdmissionRequest with operation set to Update. ValidateUpdate(ctx context.Context, req admission.Request, obj runtime.Object, oldObj runtime.Object) admission.Response // ValidateDelete yields a response to a validating AdmissionRequest with operation set to Delete. ValidateDelete(ctx context.Context, req admission.Request, obj runtime.Object) admission.Response }
Validator specifies the interface for a validating webhook.