Documentation ¶
Index ¶
- func GetOwner(dclient *client.Client, ownerMap map[kyverno.ResourceSpec]interface{}, ...)
- func NewDataStore() *dataStore
- type Generator
- type GeneratorInterface
- type Info
- type NamespacedPVControlInterface
- type NamespacedPolicyViolationController
- type PVControlInterface
- type PolicyViolationController
- type RealNamespacedPVControl
- type RealPVControl
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetOwner ¶ added in v1.0.0
func GetOwner(dclient *client.Client, ownerMap map[kyverno.ResourceSpec]interface{}, resource unstructured.Unstructured)
GetOwner of a resource by iterating over ownerReferences
func NewDataStore ¶ added in v1.0.0
func NewDataStore() *dataStore
Types ¶
type Generator ¶ added in v1.0.0
type Generator struct {
// contains filtered or unexported fields
}
Generator creates PV
func NewPVGenerator ¶ added in v1.0.0
func NewPVGenerator(client *kyvernoclient.Clientset, dclient *client.Client, pvLister kyvernolister.ClusterPolicyViolationLister, nspvLister kyvernolister.NamespacedPolicyViolationLister) *Generator
NewPVGenerator returns a new instance of policy violation generator
type GeneratorInterface ¶ added in v1.0.0
type GeneratorInterface interface {
Add(infos ...Info)
}
GeneratorInterface provides API to create PVs
type Info ¶ added in v1.0.0
type Info struct { Blocked bool PolicyName string Resource unstructured.Unstructured Rules []kyverno.ViolatedRule }
Info is a request to create PV
type NamespacedPVControlInterface ¶ added in v1.0.0
type NamespacedPVControlInterface interface { UpdateStatusPolicyViolation(newPv *kyverno.NamespacedPolicyViolation) error RemovePolicyViolation(ns, name string) error }
type NamespacedPolicyViolationController ¶ added in v1.0.0
type NamespacedPolicyViolationController struct {
// contains filtered or unexported fields
}
PolicyViolationController manages the policy violation resource - sync the lastupdate time - check if the resource is active
func NewNamespacedPolicyViolationController ¶ added in v1.0.0
func NewNamespacedPolicyViolationController(client *client.Client, kyvernoClient *kyvernoclient.Clientset, pInformer kyvernoinformer.ClusterPolicyInformer, pvInformer kyvernoinformer.NamespacedPolicyViolationInformer) (*NamespacedPolicyViolationController, error)
NewPolicyViolationController creates a new NewPolicyViolationController
func (*NamespacedPolicyViolationController) Run ¶ added in v1.0.0
func (pvc *NamespacedPolicyViolationController) Run(workers int, stopCh <-chan struct{})
Run begins watching and syncing.
type PVControlInterface ¶
type PVControlInterface interface { UpdateStatusPolicyViolation(newPv *kyverno.ClusterPolicyViolation) error RemovePolicyViolation(name string) error }
type PolicyViolationController ¶
type PolicyViolationController struct {
// contains filtered or unexported fields
}
PolicyViolationController manages the policy violation resource - sync the lastupdate time - check if the resource is active
func NewPolicyViolationController ¶
func NewPolicyViolationController(client *client.Client, kyvernoClient *kyvernoclient.Clientset, pInformer kyvernoinformer.ClusterPolicyInformer, pvInformer kyvernoinformer.ClusterPolicyViolationInformer) (*PolicyViolationController, error)
NewPolicyViolationController creates a new NewPolicyViolationController
func (*PolicyViolationController) Run ¶
func (pvc *PolicyViolationController) Run(workers int, stopCh <-chan struct{})
Run begins watching and syncing.
type RealNamespacedPVControl ¶ added in v1.0.0
type RealNamespacedPVControl struct { Client kyvernoclient.Interface Recorder record.EventRecorder }
RealNamespacedPVControl is the default implementation of NamespacedPVControlInterface.
func (RealNamespacedPVControl) RemovePolicyViolation ¶ added in v1.0.0
func (r RealNamespacedPVControl) RemovePolicyViolation(ns, name string) error
RemovePolicyViolation removes the policy violation
func (RealNamespacedPVControl) UpdateStatusPolicyViolation ¶ added in v1.0.0
func (r RealNamespacedPVControl) UpdateStatusPolicyViolation(newPv *kyverno.NamespacedPolicyViolation) error
UpdateStatusPolicyViolation updates the status for policy violation
type RealPVControl ¶
type RealPVControl struct { Client kyvernoclient.Interface Recorder record.EventRecorder }
RealPVControl is the default implementation of PVControlInterface.
func (RealPVControl) RemovePolicyViolation ¶
func (r RealPVControl) RemovePolicyViolation(name string) error
RemovePolicyViolation removes the policy violation
func (RealPVControl) UpdateStatusPolicyViolation ¶
func (r RealPVControl) UpdateStatusPolicyViolation(newPv *kyverno.ClusterPolicyViolation) error
UpdateStatusPolicyViolation updates the status for policy violation