policycache

package
v1.12.0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache added in v1.8.0

type Cache interface {
	// Set inserts a policy in the cache
	Set(string, kyvernov1.PolicyInterface, ResourceFinder) error
	// Unset removes a policy from the cache
	Unset(string)
	// GetPolicies returns all policies that apply to a namespace, including cluster-wide policies
	// If the namespace is empty, only cluster-wide policies are returned
	GetPolicies(PolicyType, schema.GroupVersionResource, string, string) []kyvernov1.PolicyInterface
}

Cache get method use for to get policy names and mostly use to test cache testcases

func NewCache added in v1.8.0

func NewCache() Cache

NewCache create a new Cache

type PolicyType

type PolicyType uint8

PolicyType represents types of policies

const (
	Mutate PolicyType = 1 << iota
	ValidateEnforce
	ValidateAudit
	Generate
	VerifyImagesMutate
	VerifyImagesValidate
)

Types of policies

type ResourceFinder added in v1.10.0

type ResourceFinder interface {
	FindResources(group, version, kind, subresource string) (map[dclient.TopLevelApiDescription]metav1.APIResource, error)
}

type TestResourceFinder added in v1.10.0

type TestResourceFinder struct{}

func (TestResourceFinder) FindResources added in v1.10.0

func (TestResourceFinder) FindResources(group, version, kind, subresource string) (map[dclient.TopLevelApiDescription]metav1.APIResource, error)

Jump to

Keyboard shortcuts

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