common

package
v1.7.2-rc2 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2022 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultRetry = wait.Backoff{
	Steps:    15,
	Duration: 100 * time.Millisecond,
	Factor:   1.0,
	Jitter:   0.1,
}

Functions

func GenerateLabelsSet

func GenerateLabelsSet(policyKey string, trigger Object) pkglabels.Set

func ManageLabels

func ManageLabels(unstr *unstructured.Unstructured, triggerResource unstructured.Unstructured)

func MutateLabelsSet

func MutateLabelsSet(policyKey string, trigger Object) pkglabels.Set

func NewBackgroundContext

func NewBackgroundContext(dclient dclient.Interface, ur *urkyverno.UpdateRequest,
	policy kyverno.PolicyInterface, trigger *unstructured.Unstructured,
	cfg config.Configuration, namespaceLabels map[string]string, logger logr.Logger) (*engine.PolicyContext, bool, error)

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 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 Object

type Object interface {
	GetName() string
	GetNamespace() string
	GetKind() string
	GetAPIVersion() 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 StatusControlInterface

type StatusControlInterface interface {
	Failed(name string, message string, genResources []kyvernov1.ResourceSpec) (*kyvernov1beta1.UpdateRequest, error)
	Success(name string, genResources []kyvernov1.ResourceSpec) (*kyvernov1beta1.UpdateRequest, error)
	Skip(name string, genResources []kyvernov1.ResourceSpec) (*kyvernov1beta1.UpdateRequest, 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

Jump to

Keyboard shortcuts

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