utils

package
v1.12.6-rc.1 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BlockRequest

func BlockRequest(engineResponses []engineapi.EngineResponse, failurePolicy kyvernov1.FailurePolicyType, log logr.Logger) bool

returns true -> if there is even one policy that blocks resource request returns false -> if all the policies are meant to report only, we dont block resource request

func ExcludeKyvernoResources

func ExcludeKyvernoResources(kind string) bool

func GenerateEvents

func GenerateEvents(engineResponses []engineapi.EngineResponse, blocked bool) []event.Info

GenerateEvents generates event info for the engine responses

func GetBlockedMessages

func GetBlockedMessages(engineResponses []engineapi.EngineResponse) string

GetBlockedMessages gets the error messages for rules with error or fail status

func GetErrorMsg

func GetErrorMsg(engineReponses []engineapi.EngineResponse) string

func GetWarningMessages

func GetWarningMessages(engineResponses []engineapi.EngineResponse) []string

func MatchDeleteOperation added in v1.11.2

func MatchDeleteOperation(rule kyvernov1.Rule) bool

MatchDeleteOperation checks if the rule specifies the DELETE operation.

Types

type PolicyContextBuilder

type PolicyContextBuilder interface {
	Build(admissionv1.AdmissionRequest, []string, []string, schema.GroupVersionKind) (*engine.PolicyContext, error)
}

func NewPolicyContextBuilder

func NewPolicyContextBuilder(
	configuration config.Configuration,
	jp jmespath.Interface,
) PolicyContextBuilder

Jump to

Keyboard shortcuts

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