validating

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2022 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// HandlerMap contains admission webhook handlers
	HandlerMap = map[string]admission.Handler{
		"validate-pod": &PodValidatingHandler{},
	}
)

Functions

func NewRequestLimitValidator

func NewRequestLimitValidator(pod *corev1.Pod) *requestLimitValidator

NewRequestLimitValidator return a requestLimitValidator object, used to validate the resource request of pod with different QoSClass and PriorityClass (including request/limits). Check README for more details.

func RegisterContainerFilterFunc added in v1.0.0

func RegisterContainerFilterFunc(fn ContainerFilterFunc)

Types

type ContainerFilterFunc added in v1.0.0

type ContainerFilterFunc func(container *corev1.Container) bool

type PodValidatingHandler

type PodValidatingHandler struct {
	Client client.Client

	// Decoder decodes objects
	Decoder *admission.Decoder
}

PodValidatingHandler handles Pod

func (*PodValidatingHandler) Handle

Handle handles admission requests.

func (*PodValidatingHandler) InjectClient

func (h *PodValidatingHandler) InjectClient(c client.Client) error

InjectClient injects the client into the PodValidatingHandler

func (*PodValidatingHandler) InjectDecoder

func (h *PodValidatingHandler) InjectDecoder(d *admission.Decoder) error

InjectDecoder injects the decoder into the PodValidatingHandler

Jump to

Keyboard shortcuts

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