policycache

package
v1.1.12 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

type Controller struct {
	Cache Interface
	// contains filtered or unexported fields
}

Controller is responsible for synchronizing Policy Cache, it embeds a policy informer to handle policy events. The cache is synced when a policy is add/update/delete. This cache is only used in the admission webhook to fast retrieve policies based on types (Mutate/ValidateEnforce/Generate).

func NewPolicyCacheController

func NewPolicyCacheController(
	pInformer kyvernoinformer.ClusterPolicyInformer,
	nspInformer kyvernoinformer.PolicyInformer,
	log logr.Logger) *Controller

NewPolicyCacheController create a new PolicyController

func (*Controller) Run

func (c *Controller) Run(workers int, stopCh <-chan struct{})

Run waits until policy informer to be synced

type Interface

type Interface interface {
	Add(policy *kyverno.ClusterPolicy)
	Remove(policy *kyverno.ClusterPolicy)
	Get(pkey PolicyType, nspace *string) []*kyverno.ClusterPolicy
}

Interface ...

type PolicyType

type PolicyType uint8
const (
	Mutate PolicyType = 1 << iota
	ValidateEnforce
	ValidateAudit
	Generate
)

Jump to

Keyboard shortcuts

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