Documentation

Index

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

    func NewEventGenerator(client *client.Client, pInformer kyvernoinformer.ClusterPolicyInformer, log logr.Logger) *Generator

      NewEventGenerator to generate a new event controller

      func (*Generator) Add

      func (gen *Generator) Add(infos ...Info)

        Add queues an event for generation

        func (*Generator) Run

        func (gen *Generator) Run(workers int, stopCh <-chan struct{})

          Run begins generator

          type Info

          type Info struct {
          	Kind      string
          	Name      string
          	Namespace string
          	Reason    string
          	Message   string
          	Source    Source
          }

            Info defines the event details

            func NewEvent

            func NewEvent(
            	log logr.Logger,
            	rkind,
            	rapiVersion,
            	rnamespace,
            	rname,
            	reason string,
            	source Source,
            	message MsgKey,
            	args ...interface{}) Info

              NewEvent builds a event creation request

              type Interface

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

                Interface to generate event

                type MsgKey

                type MsgKey int

                  MsgKey is an identified to determine the preset message formats

                  const (
                  	FPolicyApplyBlockCreate MsgKey = iota
                  	FPolicyApplyBlockUpdate
                  	FPolicyBlockResourceUpdate
                  	FPolicyApplyFailed
                  	FResourcePolicyFailed
                  )

                    Message id for pre-defined messages

                    func (MsgKey) String

                    func (k MsgKey) String() string

                    type Reason

                    type Reason int

                      Reason types of Event Reasons

                      const (
                      	//PolicyViolation there is a violation of policy
                      	PolicyViolation Reason = iota
                      	//RequestBlocked the request to create/update the resource was blocked( generated from admission-controller)
                      	RequestBlocked
                      	//PolicyFailed policy failed
                      	PolicyFailed
                      )

                      func (Reason) String

                      func (r Reason) String() string

                      type Source

                      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
                        )

                        func (Source) String

                        func (s Source) String() string