target

package
v3.18.1 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: Apache-2.0 Imports: 21 Imported by: 3

Documentation

Index

Constants

View Source
const Name = "admission.k8s.gatekeeper.sh"

Name is the name of Gatekeeper's Kubernetes validation target.

Variables

View Source
var (
	ErrCreatingMatcher = errors.New("unable to create matcher")
	ErrReviewFormat    = errors.New("unsupported request review")
	ErrRequestObject   = errors.New("invalid request object")
	ErrMatching        = errors.New("error matching the requested object")
	ErrCachingType     = errors.New("cannot cache non-namespace type")
)
View Source
var ErrOldObjectIsNil = errors.New("oldObject cannot be nil for DELETE operations")

nolint: revive // Moved error out of pkg/webhook/admission; needs capitalization for backwards compat.

Functions

func IsWipeData

func IsWipeData(o interface{}) bool

func WipeData

func WipeData() interface{}

WipeData returns a value which, when passed to client.RemoveData(), wipes all cached data.

Types

type AugmentedReview

type AugmentedReview struct {
	AdmissionRequest *admissionv1.AdmissionRequest
	Namespace        *corev1.Namespace
	Source           types.SourceType
	IsAdmission      bool
}

type AugmentedUnstructured

type AugmentedUnstructured struct {
	Object    unstructured.Unstructured
	Namespace *corev1.Namespace
	Source    types.SourceType
}

AugmentedUnstructured is an Object to review, and its Namespace (if known), and its source type.

type K8sValidationTarget

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

func (*K8sValidationTarget) GetCache

func (h *K8sValidationTarget) GetCache() handler.Cache

func (*K8sValidationTarget) GetName

func (h *K8sValidationTarget) GetName() string

func (*K8sValidationTarget) HandleReview

func (h *K8sValidationTarget) HandleReview(obj interface{}) (bool, interface{}, error)

func (*K8sValidationTarget) MatchSchema

func (*K8sValidationTarget) ProcessData

func (h *K8sValidationTarget) ProcessData(obj interface{}) (bool, []string, interface{}, error)

func (*K8sValidationTarget) ToMatcher

ToMatcher converts .spec.match in mutators to Matcher.

func (*K8sValidationTarget) ValidateConstraint

func (h *K8sValidationTarget) ValidateConstraint(u *unstructured.Unstructured) error

type Matcher

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

Matcher implements constraint.Matcher.

func (*Matcher) Match

func (m *Matcher) Match(review interface{}) (bool, error)

Jump to

Keyboard shortcuts

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