Documentation ¶
Index ¶
- func BlockRequest(engineResponses []engineapi.EngineResponse, ...) bool
- func ExcludeKyvernoResources(kind string) bool
- func GenerateEvents(engineResponses []engineapi.EngineResponse, blocked bool) []event.Info
- func GetBlockedMessages(engineResponses []engineapi.EngineResponse) string
- func GetErrorMsg(engineReponses []engineapi.EngineResponse) string
- func GetWarningMessages(engineResponses []engineapi.EngineResponse) []string
- func MatchDeleteOperation(rule kyvernov1.Rule) bool
- type PolicyContextBuilder
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 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
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
Click to show internal directories.
Click to hide internal directories.