hook

package
v1.1.0-beta-3 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

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

This section is empty.

Types

type AdmitFunc

type AdmitFunc func(ctx context.Context, r *Request) (*Result, error)

AdmitFunc defines how to process an admission request

type Handler

type Handler struct {
	Create    AdmitFunc
	Delete    AdmitFunc
	Update    AdmitFunc
	Connect   AdmitFunc
	ErrorChan chan<- error
	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 *Request) (*Result, error)

Execute evaluates the request and try to execute the function for operation specified in the request.

type Request

type Request = v1.AdmissionRequest

type Result

type Result struct {
	Allowed bool
	Msg     string
}

Result contains the result of an admission request

Jump to

Keyboard shortcuts

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