generate

package
v1.10.3 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2023 License: Apache-2.0 Imports: 41 Imported by: 1

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

func FindDownstream(client dclient.Interface, apiVersion, kind string, labels map[string]string) (*unstructured.UnstructuredList, error)

func GetUnstrRule added in v1.8.0

func GetUnstrRule(rule *kyvernov1.Generation) (*unstructured.Unstructured, error)

func TriggerFromLabels added in v1.10.0

func TriggerFromLabels(labels map[string]string) kyvernov1.ResourceSpec

func ValidateResourceWithPattern

func ValidateResourceWithPattern(log logr.Logger, resource, pattern interface{}) (string, error)

ValidateResourceWithPattern is a start of element-by-element validation process It assumes that validation is started from root, so "/" is passed Anchors are not expected in the pattern

Types

type GenerateController

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

func NewGenerateController

NewGenerateController returns an instance of the Generate-Request Controller

func NewGenerateControllerWithOnlyClient added in v1.8.0

func NewGenerateControllerWithOnlyClient(client dclient.Interface, engine engineapi.Engine) *GenerateController

NewGenerateControllerWithOnlyClient returns an instance of Controller with only the client.

func (*GenerateController) ApplyGeneratePolicy added in v1.8.0

func (c *GenerateController) ApplyGeneratePolicy(log logr.Logger, policyContext *engine.PolicyContext, ur kyvernov1beta1.UpdateRequest, applicableRules []string) (genResources []kyvernov1.ResourceSpec, err error)

func (*GenerateController) GetUnstrResource added in v1.8.0

func (c *GenerateController) GetUnstrResource(genResourceSpec kyvernov1.ResourceSpec) (*unstructured.Unstructured, error)

GetUnstrResource converts ResourceSpec object to type Unstructured

func (*GenerateController) ProcessUR

type Handler

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

func NewHandler

func NewHandler(element string, pattern interface{}, path string) Handler

func (Handler) Handle

func (dh Handler) Handle(handler resourceElementHandler, resourceMap map[string]interface{}, originPattern interface{}) (string, error)

Jump to

Keyboard shortcuts

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