mutating

package
v0.37.0 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2026 License: Apache-2.0 Imports: 42 Imported by: 7

Documentation

Index

Constants

View Source
const (
	// PluginName indicates the name of admission plug-in
	PluginName = "MutatingAdmissionPolicy"
)

Variables

This section is empty.

Functions

func ErrorType added in v0.34.0

func ErrorType(err error) celmetrics.MutationErrorType

ErrorType decodes the error to determine the error type that the metrics understand.

func NewMutatingAdmissionPolicyAccessor

func NewMutatingAdmissionPolicyAccessor(obj *Policy) generic.PolicyAccessor

func NewMutatingAdmissionPolicyBindingAccessor

func NewMutatingAdmissionPolicyBindingAccessor(obj *PolicyBinding) generic.BindingAccessor

func Register

func Register(plugins *admission.Plugins)

Register registers a plugin

Types

type MutationEvaluationFunc

type MutationEvaluationFunc func(
	ctx context.Context,
	matchedResource schema.GroupVersionResource,
	versionedAttr *admission.VersionedAttributes,
	o admission.ObjectInterfaces,
	versionedParams runtime.Object,
	namespace *corev1.Namespace,
	typeConverter managedfields.TypeConverter,
	runtimeCELCostBudget int64,
	authorizer authorizer.UnconditionalAuthorizer,
) (runtime.Object, error)

type Mutator

type Mutator struct {
}

type Plugin

type Plugin struct {
	*generic.Plugin[PolicyHook]
}

Plugin is an implementation of admission.Interface.

func NewPlugin

func NewPlugin(configFile io.Reader) (*Plugin, error)

NewPlugin returns a generic admission webhook plugin.

func (*Plugin) Admit

Admit makes an admission decision based on the request attributes.

func (*Plugin) InspectFeatureGates

func (a *Plugin) InspectFeatureGates(featureGates featuregate.FeatureGate)

func (*Plugin) SetManifestLoaders added in v0.36.0

func (a *Plugin) SetManifestLoaders(loaders *initializer.ManifestLoaders)

SetManifestLoaders provides the manifest load functions for scheme-based defaulting and validation.

type Policy

type Policy = v1.MutatingAdmissionPolicy

type PolicyEvaluator

type PolicyEvaluator struct {
	Matcher            matchconditions.Matcher
	Mutators           []patch.Patcher
	CompositedCompiler *cel.CompositedCompiler
	Error              error
}

type Variable

type Variable struct {
	Name       string
	Expression string
}

Variable is a named expression for composition.

func (*Variable) GetExpression

func (v *Variable) GetExpression() string

func (*Variable) GetName

func (v *Variable) GetName() string

func (*Variable) ReturnTypes

func (v *Variable) ReturnTypes() []*celgo.Type

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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