common

package
v1.7.0-rc1 Latest Latest
Warning

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

Go to latest
Published: May 12, 2022 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ManageLabels

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

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)

func PatchUpdateRequest

func PatchUpdateRequest(ur *urkyverno.UpdateRequest, patch jsonutils.Patch, client kyvernoclient.Interface, subresources ...string) (*urkyverno.UpdateRequest, error)

PatchUpdateRequest patches a update request object

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

type StatusControl struct {
	Client kyvernoclient.Interface
}

StatusControl is default implementaation of GRStatusControlInterface

func (StatusControl) Failed

func (sc StatusControl) Failed(ur urkyverno.UpdateRequest, message string, genResources []kyverno.ResourceSpec) error

Failed sets ur status.state to failed with message

func (StatusControl) Skip

func (sc StatusControl) Skip(ur urkyverno.UpdateRequest, genResources []kyverno.ResourceSpec) error

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

func (StatusControl) Success

func (sc StatusControl) Success(ur urkyverno.UpdateRequest, genResources []kyverno.ResourceSpec) error

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

type StatusControlInterface

type StatusControlInterface interface {
	Failed(ur urkyverno.UpdateRequest, message string, genResources []kyverno.ResourceSpec) error
	Success(ur urkyverno.UpdateRequest, genResources []kyverno.ResourceSpec) error
	Skip(gr urkyverno.UpdateRequest, 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

Jump to

Keyboard shortcuts

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