Documentation ¶
Index ¶
- Constants
- func FindDownstream(client dclient.Interface, apiVersion, kind string, labels map[string]string) (*unstructured.UnstructuredList, error)
- func GenerateLabelsSet(policyKey string) pkglabels.Set
- func GetResource(client dclient.Interface, resourceSpec kyvernov1.ResourceSpec, ...) (resource *unstructured.Unstructured, err error)
- func ManageLabels(unstr *unstructured.Unstructured, triggerResource unstructured.Unstructured, ...)
- func MutateLabelsSet(policyKey string, trigger Object) pkglabels.Set
- func NewBackgroundContext(logger logr.Logger, dclient dclient.Interface, ...) (*engine.PolicyContext, error)
- func PolicyInfo(labels map[string]string, policy kyvernov1.PolicyInterface, ruleName string)
- func PolicyKey(namespace, name string) string
- func ResourceSpecFromUnstructured(obj unstructured.Unstructured) kyvernov1.ResourceSpec
- func TagSource(labels map[string]string, obj Object)
- func TriggerInfo(labels map[string]string, obj unstructured.Unstructured)
- func UpdateStatus(client versioned.Interface, ...) (*kyvernov2.UpdateRequest, error)
- type Object
- type StatusControlInterface
Constants ¶
View Source
const ( GeneratePolicyLabel = "generate.kyverno.io/policy-name" GeneratePolicyNamespaceLabel = "generate.kyverno.io/policy-namespace" GenerateRuleLabel = "generate.kyverno.io/rule-name" GenerateTriggerNameLabel = "generate.kyverno.io/trigger-name" GenerateTriggerUIDLabel = "generate.kyverno.io/trigger-uid" GenerateTriggerNSLabel = "generate.kyverno.io/trigger-namespace" GenerateTriggerKindLabel = "generate.kyverno.io/trigger-kind" GenerateTriggerVersionLabel = "generate.kyverno.io/trigger-version" GenerateTriggerGroupLabel = "generate.kyverno.io/trigger-group" GenerateSourceNameLabel = "generate.kyverno.io/source-name" GenerateSourceUIDLabel = "generate.kyverno.io/source-uid" GenerateSourceNSLabel = "generate.kyverno.io/source-namespace" GenerateSourceKindLabel = "generate.kyverno.io/source-kind" GenerateSourceVersionLabel = "generate.kyverno.io/source-version" GenerateSourceGroupLabel = "generate.kyverno.io/source-group" GenerateTypeCloneSourceLabel = "generate.kyverno.io/clone-source" )
Variables ¶
This section is empty.
Functions ¶
func FindDownstream ¶ added in v1.11.0
func FindDownstream(client dclient.Interface, apiVersion, kind string, labels map[string]string) (*unstructured.UnstructuredList, error)
func GenerateLabelsSet ¶
func GetResource ¶
func GetResource(client dclient.Interface, resourceSpec kyvernov1.ResourceSpec, urSpec kyvernov2.UpdateRequestSpec, log logr.Logger) (resource *unstructured.Unstructured, err error)
func ManageLabels ¶
func ManageLabels(unstr *unstructured.Unstructured, triggerResource unstructured.Unstructured, policy kyvernov1.PolicyInterface, ruleName string)
func NewBackgroundContext ¶
func NewBackgroundContext( logger logr.Logger, dclient dclient.Interface, urContext kyvernov2.UpdateRequestSpecContext, policy kyvernov1.PolicyInterface, trigger *unstructured.Unstructured, cfg config.Configuration, jp jmespath.Interface, namespaceLabels map[string]string, ) (*engine.PolicyContext, error)
func PolicyInfo ¶ added in v1.10.0
func PolicyInfo(labels map[string]string, policy kyvernov1.PolicyInterface, ruleName string)
func ResourceSpecFromUnstructured ¶ added in v1.10.0
func ResourceSpecFromUnstructured(obj unstructured.Unstructured) kyvernov1.ResourceSpec
func TriggerInfo ¶ added in v1.10.0
func TriggerInfo(labels map[string]string, obj unstructured.Unstructured)
func UpdateStatus ¶
func UpdateStatus(client versioned.Interface, urLister kyvernov2listers.UpdateRequestNamespaceLister, name string, state kyvernov2.UpdateRequestState, message string, genResources []kyvernov1.ResourceSpec) (*kyvernov2.UpdateRequest, error)
Types ¶
type StatusControlInterface ¶
type StatusControlInterface interface { Failed(name string, message string, genResources []kyvernov1.ResourceSpec) (*kyvernov2.UpdateRequest, error) Success(name string, genResources []kyvernov1.ResourceSpec) (*kyvernov2.UpdateRequest, error) Skip(name string, genResources []kyvernov1.ResourceSpec) (*kyvernov2.UpdateRequest, error) }
StatusControlInterface provides interface to update status subresource
func NewStatusControl ¶
func NewStatusControl(client versioned.Interface, urLister kyvernov2listers.UpdateRequestNamespaceLister) StatusControlInterface
Source Files ¶
Click to show internal directories.
Click to hide internal directories.