admission

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Reject is used to pass status between webhooks
	PodValidationRejectAnnotation = "pods.warden.kyma-project.io/validate-reject"
	ValidationReject              = "reject"
)
View Source
const (
	DefaultingPath = "/defaulting/pods"
)
View Source
const PodType = "Pod"
View Source
const (
	ValidationPath = "/validation/pods"
)

Variables

This section is empty.

Functions

func IsValidationNeededForOperation

func IsValidationNeededForOperation(operation admissionv1.Operation) bool

Types

type DefaultingWebHook

type DefaultingWebHook struct {
	// contains filtered or unexported fields
}

func NewDefaultingWebhook

func NewDefaultingWebhook(client k8sclient.Client, ValidationSvc validate.PodValidator, timeout time.Duration, strictMode bool, logger *zap.SugaredLogger) *DefaultingWebHook

func (*DefaultingWebHook) Handle

func (*DefaultingWebHook) InjectDecoder

func (w *DefaultingWebHook) InjectDecoder(decoder *admission.Decoder) error

type Handler

type Handler func(ctx context.Context, req admission.Request) admission.Response

func HandleWithLogger

func HandleWithLogger(baseLogger *zap.SugaredLogger, handler Handler) Handler

func HandleWithTimeout

func HandleWithTimeout(timeout time.Duration, handler Handler, timeoutHandler TimeoutHandler) Handler

func HandlerWithTimeMeasure

func HandlerWithTimeMeasure(handler Handler) Handler

type TimeoutHandler

type TimeoutHandler func(ctx context.Context, err error, req admission.Request) admission.Response

type ValidationWebhook

type ValidationWebhook struct {
	// contains filtered or unexported fields
}

func NewValidationWebhook

func NewValidationWebhook(logger *zap.SugaredLogger) *ValidationWebhook

func (*ValidationWebhook) Handle

func (*ValidationWebhook) InjectDecoder

func (w *ValidationWebhook) InjectDecoder(decoder *admission.Decoder) error

Jump to

Keyboard shortcuts

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