policy

package
v1.14.0 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2025 License: Apache-2.0 Imports: 46 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ForbiddenUserVariables = []*regexp.Regexp{
	regexp.MustCompile(`[^\.](serviceAccountName)\b`),
	regexp.MustCompile(`[^\.](serviceAccountNamespace)\b`),
	regexp.MustCompile(`[^\.](request.userInfo)\b`),
	regexp.MustCompile(`[^\.](request.roles)\b`),
	regexp.MustCompile(`[^\.](request.clusterRoles)\b`),
}

Functions

func Validate

func Validate(policy, oldPolicy kyvernov1.PolicyInterface, client dclient.Interface, mock bool, backgroundSA, reportsSA string) ([]string, error)

Validate checks the policy and rules declarations for required configurations

func ValidateCustomWebhookMatchConditions added in v1.13.1

func ValidateCustomWebhookMatchConditions(wc []admissionregistrationv1.MatchCondition) error

func ValidateOnPolicyUpdate

func ValidateOnPolicyUpdate(p kyvernov1.PolicyInterface, onPolicyUpdate bool) error

func ValidateVariables

func ValidateVariables(p kyvernov1.PolicyInterface, backgroundMode bool) error

Types

type Validation

type Validation interface {
	Validate(ctx context.Context, verbs []string) (warnings []string, path string, err error)
}

Validation provides methods to validate a rule

Jump to

Keyboard shortcuts

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