interrupter

package
v0.4.5 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2023 License: Apache-2.0 Imports: 26 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PolicyInterrupter

type PolicyInterrupter interface {
	// OnMutating called on "/mutating" api to complete policy
	// return nil means obj is not defined policy
	OnMutating(obj, oldObj *unstructured.Unstructured, operation admissionv1.Operation) ([]jsonpatchv2.JsonPatchOperation, error)
	// OnValidating called on "/validating" api to validate policy
	// return nil means obj is not defined policy or no invalid field
	OnValidating(obj, oldObj *unstructured.Unstructured, operation admissionv1.Operation) error
	// OnStartUp called when webhook process initialize
	// return error if initial phase get any error
	OnStartUp() error
}

PolicyInterrupter defines interrupt process for policy change It validate and mutate policy.

func NewClusterOverridePolicyInterrupter

func NewClusterOverridePolicyInterrupter(opInterrupter PolicyInterrupter, lister v1alpha1.ClusterOverridePolicyLister) PolicyInterrupter

type PolicyInterrupterManager

type PolicyInterrupterManager interface {
	PolicyInterrupter
	// AddInterrupter add a PolicyInterrupter to manager,
	//  it will replace interrupter if already add with same gvk.s
	AddInterrupter(gvk schema.GroupVersionKind, pi PolicyInterrupter)
}

PolicyInterrupterManager manage multi PolicyInterrupter and decide which one to use by gvk.

func NewPolicyInterrupterManager

func NewPolicyInterrupterManager() PolicyInterrupterManager

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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