Documentation

Index

Constants

View Source
const (
	//Skip : failed to process rule, will not update the resource
	Skip ResourceMode = "SKIP"
	//Create : create a new resource
	Create = "CREATE"
	//Update : update/overwrite the new resource
	Update = "UPDATE"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigNotFound

type ConfigNotFound struct {
	// contains filtered or unexported fields
}

ConfigNotFound stores the config information

func NewConfigNotFound

func NewConfigNotFound(config interface{}, kind, namespace, name string) *ConfigNotFound

NewConfigNotFound returns a new NewConfigNotFound error

func (*ConfigNotFound) Error

func (e *ConfigNotFound) Error() string

type Controller

type Controller struct {
	Config config.Interface
	// contains filtered or unexported fields
}

Controller manages the life-cycle for Generate-Requests and applies generate rule

func NewController

func NewController(
	kyvernoClient *kyvernoclient.Clientset,
	client *dclient.Client,
	policyInformer kyvernoinformer.ClusterPolicyInformer,
	grInformer kyvernoinformer.GenerateRequestInformer,
	eventGen event.Interface,
	dynamicInformer dynamicinformer.DynamicSharedInformerFactory,
	policyStatus policystatus.Listener,
	log logr.Logger,
	dynamicConfig config.Interface,
	resourceCache resourcecache.ResourceCacheIface,
) (*Controller, error)

NewController returns an instance of the Generate-Request Controller

func (*Controller) EnqueueGenerateRequestFromWebhook

func (c *Controller) EnqueueGenerateRequestFromWebhook(gr *kyverno.GenerateRequest)

EnqueueGenerateRequestFromWebhook - enqueing generate requests from webhook

func (*Controller) Run

func (c *Controller) Run(workers int, stopCh <-chan struct{})

Run ...

type NotFound

type NotFound struct {
	// contains filtered or unexported fields
}

NotFound stores the resource that was not found

func NewNotFound

func NewNotFound(kind, namespace, name string) *NotFound

NewNotFound returns a new NotFound error

func (*NotFound) Error

func (e *NotFound) Error() string

type ParseFailed

type ParseFailed struct {
	// contains filtered or unexported fields
}

ParseFailed stores the resource that failed to parse

func NewParseFailed

func NewParseFailed(spec interface{}, err error) *ParseFailed

NewParseFailed returns a new ParseFailed error

func (*ParseFailed) Error

func (e *ParseFailed) Error() string

type ResourceMode

type ResourceMode string

ResourceMode defines the mode for generated resource

type StatusControl

type StatusControl struct {
	// contains filtered or unexported fields
}

StatusControl is default implementaation of GRStatusControlInterface

func (StatusControl) Failed

func (sc StatusControl) Failed(gr kyverno.GenerateRequest, message string, genResources []kyverno.ResourceSpec) error

Failed sets gr status.state to failed with message

func (StatusControl) Success

func (sc StatusControl) Success(gr kyverno.GenerateRequest, genResources []kyverno.ResourceSpec) error

Success sets the gr status.state to completed and clears message

type StatusControlInterface

type StatusControlInterface interface {
	Failed(gr kyverno.GenerateRequest, message string, genResources []kyverno.ResourceSpec) error
	Success(gr kyverno.GenerateRequest, genResources []kyverno.ResourceSpec) error
}

StatusControlInterface provides interface to update status subresource

type Violation

type Violation struct {
	// contains filtered or unexported fields
}

Violation stores the rule that violated

func NewViolation

func NewViolation(rule string, err error) *Violation

NewViolation returns a new Violation error

func (*Violation) Error

func (e *Violation) Error() string

Directories

Path Synopsis
cleanup