Documentation ¶
Index ¶
- func GetResource(client dclient.Interface, urSpec urkyverno.UpdateRequestSpec, log logr.Logger) (*unstructured.Unstructured, error)
- func ManageLabels(unstr *unstructured.Unstructured, triggerResource unstructured.Unstructured)
- func NewBackgroundContext(dclient dclient.Interface, ur *urkyverno.UpdateRequest, ...) (*engine.PolicyContext, bool, error)
- func PatchUpdateRequest(ur *urkyverno.UpdateRequest, patch jsonutils.Patch, ...) (*urkyverno.UpdateRequest, error)
- type ConfigNotFound
- type NotFound
- type ParseFailed
- type StatusControl
- type StatusControlInterface
- type Violation
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetResource ¶
func GetResource(client dclient.Interface, urSpec urkyverno.UpdateRequestSpec, log logr.Logger) (*unstructured.Unstructured, error)
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 ¶
NewNotFound returns a new NotFound error
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 ¶
NewViolation returns a new Violation error