Documentation
¶
Overview ¶
Package hook contains structures and interfaces for implementing admission webhooks handlers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllowAlways ¶ added in v1.2.6
func AllowAlways(_ context.Context, _ *types.AdmissionReview, _ metav1.Object) (*types.AdmissionResponse, error)
AllowAlways is a trivial AdmitFunc that always allows the admission request. This is useful for implementing fail-open webhook behavior.
Types ¶
type AdmitFunc ¶
type AdmitFunc func(ctx context.Context, r *types.AdmissionReview, obj metav1.Object) (*types.AdmissionResponse, error)
AdmitFunc defines how to process an admission request
type Handler ¶
type Handler struct {
Accessor config.ConfigAccessor
ObjectCreator types.ObjectCreator
ObjectType metav1.Object
Create AdmitFunc
Delete AdmitFunc
Update AdmitFunc
Connect AdmitFunc
Store types.ResourceStore
}
Handler represents the set of functions for each operation in an admission webhook.
func (*Handler) Execute ¶
func (h *Handler) Execute(ctx context.Context, r *types.AdmissionReview) (*types.AdmissionResponse, error)
Execute evaluates the request and try to execute the function for operation specified in the request.
Click to show internal directories.
Click to hide internal directories.