webhook

package
v1.8.5 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnsureStringSlicesAreEquivalent added in v1.7.0

func EnsureStringSlicesAreEquivalent(a []string, b []string) bool

EnsureStringSlicesAreEquivalent returns if two string slices have equal lengths, and that they have the exact same items; it does not enforce strict ordering of items.

func NewMutatingWebhook

func NewMutatingWebhook(defaulter Defaulter, client client.Client) *admission.Webhook

NewMutatingWebhook creates a new Webhook for Defaulting the provided type.

func NewValidatingWebhook

func NewValidatingWebhook(validator Validator, client client.Client) *admission.Webhook

NewValidatingWebhook creates a new Webhook for validating the provided type.

func ValidateImmutable added in v1.6.0

func ValidateImmutable(path *field.Path, oldVal, newVal any) *field.Error

ValidateImmutable validates equality across two values, and returns a meaningful error to indicate a changed value, a newly set value, or a newly unset value.

func ValidateZeroTransition added in v1.7.6

func ValidateZeroTransition(path *field.Path, oldVal, newVal any) *field.Error

ValidateZeroTransition validates equality across two values, with only exception to allow the value to transition of a zero value.

Types

type Defaulter

type Defaulter interface {
	runtime.Object
	Default(client client.Client)
}

Defaulter defines functions for setting defaults on resources.

type Validator

type Validator interface {
	runtime.Object
	ValidateCreate(client client.Client) error
	ValidateUpdate(old runtime.Object, client client.Client) error
	ValidateDelete(client client.Client) error
}

Validator defines functions for validating an operation.

Jump to

Keyboard shortcuts

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