Documentation ¶
Index ¶
- Constants
- func GetUnstrRule(rule *kyvernov1.Generation) (*unstructured.Unstructured, error)
- 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, processExisting bool, err error)
- func (c *GenerateController) ApplyResource(resource *unstructured.Unstructured) error
- func (c *GenerateController) GetUnstrResource(genResourceSpec kyvernov1.ResourceSpec) (*unstructured.Unstructured, error)
- func (c *GenerateController) ProcessUR(ur *kyvernov1beta1.UpdateRequest) error
- type GenerateResponse
- type Handler
- type ResourceMode
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 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, rclient registryclient.Client, policyLister kyvernov1listers.ClusterPolicyLister, npolicyLister kyvernov1listers.PolicyLister, urLister kyvernov1beta1listers.UpdateRequestNamespaceLister, nsLister corev1listers.NamespaceLister, dynamicConfig config.Configuration, informerCacheResolvers resolvers.ConfigmapResolver, eventGen event.Interface, log logr.Logger, ) *GenerateController
NewGenerateController returns an instance of the Generate-Request Controller
func NewGenerateControllerWithOnlyClient ¶ added in v1.8.0
func NewGenerateControllerWithOnlyClient(client dclient.Interface) *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, processExisting bool, err error)
func (*GenerateController) ApplyResource ¶ added in v1.8.0
func (c *GenerateController) ApplyResource(resource *unstructured.Unstructured) 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
type GenerateResponse ¶ added in v1.8.0
type GenerateResponse struct { Data map[string]interface{} Action ResourceMode GenKind, GenName, GenNamespace, GenAPIVersion string Error error }
Click to show internal directories.
Click to hide internal directories.