Documentation ¶
Index ¶
- Constants
- func GetUnstrRule(rule *kyvernov1.Generation) (*unstructured.Unstructured, error)
- func TriggerFromLabels(labels map[string]string) kyvernov1.ResourceSpec
- func ValidateResourceWithPattern(log logr.Logger, resource, pattern interface{}) (string, error)
- type GenerateController
- func (c *GenerateController) ApplyGeneratePolicy(log logr.Logger, policyContext *engine.PolicyContext, ...) (genResources []kyvernov1.ResourceSpec, err error)
- func (c *GenerateController) GetUnstrResource(genResourceSpec kyvernov1.ResourceSpec) (*unstructured.Unstructured, error)
- func (c *GenerateController) ProcessUR(ur *kyvernov1beta1.UpdateRequest) error
- type Handler
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 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 ¶
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 ¶
func NewGenerateController( client dclient.Interface, kyvernoClient versioned.Interface, statusControl common.StatusControlInterface, engine engineapi.Engine, policyLister kyvernov1listers.ClusterPolicyLister, npolicyLister kyvernov1listers.PolicyLister, urLister kyvernov1beta1listers.UpdateRequestNamespaceLister, nsLister corev1listers.NamespaceLister, dynamicConfig config.Configuration, eventGen event.Interface, log logr.Logger, jp jmespath.Interface, ) *GenerateController
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 ¶
func (c *GenerateController) ProcessUR(ur *kyvernov1beta1.UpdateRequest) error
Click to show internal directories.
Click to hide internal directories.