event

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: 27 Imported by: 1

Documentation

Index

Constants

View Source
const (
	Workers        = 3
	ControllerName = "kyverno-events"
)

Variables

This section is empty.

Functions

func NewEventGenerator added in v0.8.0

func NewEventGenerator(eventsClient v1.EventsV1Interface, logger logr.Logger, maxQueuedEvents int, omitEvents ...string) *controller

NewEventGenerator to generate a new event controller

Types

type Action added in v1.10.5

type Action string

Action types of Event Actions

const (
	ResourceBlocked   Action = "Resource Blocked"
	ResourcePassed    Action = "Resource Passed"
	ResourceGenerated Action = "Resource Generated"
	ResourceMutated   Action = "Resource Mutated"
	ResourceCleanedUp Action = "Resource Cleaned Up"
	None              Action = "None"
)

type Info

type Info struct {
	Regarding corev1.ObjectReference
	Related   *corev1.ObjectReference
	Reason    Reason
	Message   string
	Action    Action
	Source    Source
	Type      string
}

Info defines the event details

func NewBackgroundFailedEvent added in v1.7.0

func NewBackgroundFailedEvent(err error, policy kyvernov1.PolicyInterface, rule string, source Source, resource kyvernov1.ResourceSpec) []Info

func NewBackgroundSuccessEvent added in v1.7.0

func NewBackgroundSuccessEvent(source Source, policy kyvernov1.PolicyInterface, resources []kyvernov1.ResourceSpec) []Info

func NewCleanupPolicyEvent added in v1.10.5

func NewCleanupPolicyEvent(policy kyvernov2alpha1.CleanupPolicyInterface, resource unstructured.Unstructured, err error) Info

func NewFailedEvent added in v1.10.0

func NewFailedEvent(err error, policy, rule string, source Source, resource kyvernov1.ResourceSpec) Info

func NewPolicyAppliedEvent added in v1.7.0

func NewPolicyAppliedEvent(source Source, engineResponse engineapi.EngineResponse) Info

func NewPolicyExceptionEvents added in v1.9.0

func NewPolicyExceptionEvents(engineResponse engineapi.EngineResponse, ruleResp engineapi.RuleResponse, source Source) []Info

func NewPolicyFailEvent added in v1.7.0

func NewPolicyFailEvent(source Source, reason Reason, engineResponse engineapi.EngineResponse, ruleResp engineapi.RuleResponse, blocked bool) Info

func NewResourceGenerationEvent added in v1.10.2

func NewResourceGenerationEvent(policy, rule string, source Source, resource kyvernov1.ResourceSpec) Info

func NewResourceViolationEvent added in v1.7.0

func NewResourceViolationEvent(source Source, reason Reason, engineResponse engineapi.EngineResponse, ruleResp engineapi.RuleResponse) Info

func NewValidatingAdmissionPolicyEvent added in v1.10.5

func NewValidatingAdmissionPolicyEvent(policy kyvernov1.PolicyInterface, vapName, vapBindingName string) []Info

func (*Info) Resource

func (i *Info) Resource() string

type Interface added in v0.8.0

type Interface interface {
	Add(infoList ...Info)
}

Interface to generate event

func NewFake added in v1.8.0

func NewFake() Interface

type Reason

type Reason string

Reason types of Event Reasons

const (
	PolicyViolation Reason = "PolicyViolation"
	PolicyApplied   Reason = "PolicyApplied"
	PolicyError     Reason = "PolicyError"
	PolicySkipped   Reason = "PolicySkipped"
)

type Source added in v1.1.0

type Source string

Source of event generation

const (
	// AdmissionController : event generated in admission-control webhook
	AdmissionController Source = "kyverno-admission"
	// PolicyController : event generated in policy-controller
	PolicyController Source = "kyverno-scan"
	// GeneratePolicyController : event generated in generate policyController
	GeneratePolicyController Source = "kyverno-generate"
	// MutateExistingController : event generated for mutateExisting policies
	MutateExistingController Source = "kyverno-mutate"
	// CleanupController : event generated for cleanup policies
	CleanupController Source = "kyverno-cleanup"
)

Jump to

Keyboard shortcuts

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