webhook

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2022 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrRequestInvalid = errors.New("invalid request")
)
View Source
var (
	ErrValidationFailed = "failed validation"
)

Functions

This section is empty.

Types

type Operation added in v0.1.0

type Operation struct {
	Log         *logger.Logger
	Resource    client.Object
	PodSpec     *corev1.PodSpec
	Validations []*validate.Validation
	Review      *admissionv1.AdmissionReview

	// functions
	OperationStep []OperationStep
	RegisterFunc  func()

	// admission for this operation
	Patches        []map[string]string
	Permitted      bool
	ResponseError  error
	ResponseReason metav1.StatusReason
	StatusCode     int
}

type OperationStep added in v0.1.0

type OperationStep func(http.ResponseWriter, *http.Request, *Operation) (int, error)

type Webhook

type Webhook struct {
	Certificate *tls.Certificate
	Client      kubernetes.Interface
	Log         *logger.Logger
	Router      *mux.Router
	Port        int
}

func NewWebhook

func NewWebhook() (*Webhook, error)

Jump to

Keyboard shortcuts

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