Documentation ¶
Index ¶
- type Generator
- type Info
- func NewBackgroundFailedEvent(err error, policy, rule string, source Source, r *unstructured.Unstructured) []Info
- func NewBackgroundSuccessEvent(policy, rule string, source Source, r *unstructured.Unstructured) []Info
- func NewPolicyAppliedEvent(source Source, engineResponse *response.EngineResponse) Info
- func NewPolicyExceptionEvents(engineResponse *response.EngineResponse, ruleResp *response.RuleResponse) []Info
- func NewPolicyFailEvent(source Source, reason Reason, engineResponse *response.EngineResponse, ...) Info
- func NewResourceViolationEvent(source Source, reason Reason, engineResponse *response.EngineResponse, ...) Info
- type Interface
- type Reason
- type Source
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Generator ¶
type Generator struct {
// contains filtered or unexported fields
}
Generator generate events
func NewEventGenerator ¶ added in v0.8.0
func NewEventGenerator(client dclient.Interface, cpInformer kyvernov1informers.ClusterPolicyInformer, pInformer kyvernov1informers.PolicyInformer, maxQueuedEvents int, log logr.Logger) *Generator
NewEventGenerator to generate a new event controller
type Info ¶
type Info struct { Kind string Name string Namespace string Reason string Message string Source Source }
Info defines the event details
func NewBackgroundFailedEvent ¶ added in v1.7.0
func NewBackgroundFailedEvent(err error, policy, rule string, source Source, r *unstructured.Unstructured) []Info
func NewBackgroundSuccessEvent ¶ added in v1.7.0
func NewBackgroundSuccessEvent(policy, rule string, source Source, r *unstructured.Unstructured) []Info
func NewPolicyAppliedEvent ¶ added in v1.7.0
func NewPolicyAppliedEvent(source Source, engineResponse *response.EngineResponse) Info
func NewPolicyExceptionEvents ¶ added in v1.9.0
func NewPolicyExceptionEvents(engineResponse *response.EngineResponse, ruleResp *response.RuleResponse) []Info
func NewPolicyFailEvent ¶ added in v1.7.0
func NewPolicyFailEvent(source Source, reason Reason, engineResponse *response.EngineResponse, ruleResp *response.RuleResponse, blocked bool) Info
func NewResourceViolationEvent ¶ added in v1.7.0
func NewResourceViolationEvent(source Source, reason Reason, engineResponse *response.EngineResponse, ruleResp *response.RuleResponse) Info
type Interface ¶ added in v0.8.0
type Interface interface {
Add(infoList ...Info)
}
Interface to generate event
type Source ¶ added in v1.1.0
type Source int
Source of event generation
const ( // AdmissionController : event generated in admission-control webhook AdmissionController Source = iota // PolicyController : event generated in policy-controller PolicyController // GeneratePolicyController : event generated in generate policyController GeneratePolicyController // MutateExistingController : event generated for mutateExisting policies MutateExistingController )
Click to show internal directories.
Click to hide internal directories.