generate

package
v1.1.12 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 18, 2020 License: Apache-2.0 Imports: 28 Imported by: 0

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

func ConvertToUnstructured added in v1.1.3

func ConvertToUnstructured(data []byte) (*unstructured.Unstructured, error)

ConvertToUnstructured converts the resource to unstructured format

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,
	pInformer kyvernoinformer.ClusterPolicyInformer,
	grInformer kyvernoinformer.GenerateRequestInformer,
	eventGen event.Interface,
	dynamicInformer dynamicinformer.DynamicSharedInformerFactory,
	policyStatus policystatus.Listener,
	log logr.Logger,
	dynamicConfig config.Interface,
) *Controller

NewController returns an instance of the Generate-Request Controller

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 added in v1.1.3

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

Jump to

Keyboard shortcuts

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