mirror of
https://github.com/kyverno/policy-reporter.git
synced 2024-12-14 11:57:32 +00:00
commit
dde06864d6
4 changed files with 4 additions and 4 deletions
|
@ -52,7 +52,7 @@ func (f *genericInformer) Lister() cache.GenericLister {
|
||||||
// TODO extend this to unknown resources with a client pool
|
// TODO extend this to unknown resources with a client pool
|
||||||
func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource) (GenericInformer, error) {
|
func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource) (GenericInformer, error) {
|
||||||
switch resource {
|
switch resource {
|
||||||
// Group=wgpolicyk8s.io, Version=v1alpha2
|
// Group=wgpolicyk8s.io, Version=v1alpha2
|
||||||
case policyreportv1alpha2.SchemeGroupVersion.WithResource("clusterpolicyreports"):
|
case policyreportv1alpha2.SchemeGroupVersion.WithResource("clusterpolicyreports"):
|
||||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Wgpolicyk8s().V1alpha2().ClusterPolicyReports().Informer()}, nil
|
return &genericInformer{resource: resource.GroupResource(), informer: f.Wgpolicyk8s().V1alpha2().ClusterPolicyReports().Informer()}, nil
|
||||||
case policyreportv1alpha2.SchemeGroupVersion.WithResource("policyreports"):
|
case policyreportv1alpha2.SchemeGroupVersion.WithResource("policyreports"):
|
||||||
|
|
|
@ -8,7 +8,7 @@ type PolicyReportResultListener = func(PolicyReport, Result, bool)
|
||||||
|
|
||||||
// PolicyReportClient watches for PolicyReport Events and executes registered callback
|
// PolicyReportClient watches for PolicyReport Events and executes registered callback
|
||||||
type PolicyReportClient interface {
|
type PolicyReportClient interface {
|
||||||
// WatchPolicyReports starts to watch for PolicyReport LifecycleEvent events
|
// Run WatchPolicyReports starts to watch for PolicyReport LifecycleEvent events
|
||||||
Run(stopper chan struct{}) error
|
Run(stopper chan struct{}) error
|
||||||
// HasSynced the configured PolicyReport
|
// HasSynced the configured PolicyReport
|
||||||
HasSynced() bool
|
HasSynced() bool
|
||||||
|
|
|
@ -11,7 +11,7 @@ type EventPublisher interface {
|
||||||
UnregisterListener(string)
|
UnregisterListener(string)
|
||||||
// GetListener returns a list of all registered Listeners
|
// GetListener returns a list of all registered Listeners
|
||||||
GetListener() map[string]PolicyReportListener
|
GetListener() map[string]PolicyReportListener
|
||||||
// Process LifecycleEvent with all registered listeners
|
// Publish Process LifecycleEvent with all registered listeners
|
||||||
Publish(event LifecycleEvent)
|
Publish(event LifecycleEvent)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@ type PolicyReportStore interface {
|
||||||
Get(id string) (PolicyReport, bool)
|
Get(id string) (PolicyReport, bool)
|
||||||
// Add a PolicyReport to the Store
|
// Add a PolicyReport to the Store
|
||||||
Add(r PolicyReport) error
|
Add(r PolicyReport) error
|
||||||
// Add a PolicyReport to the Store
|
// Update a PolicyReport to the Store
|
||||||
Update(r PolicyReport) error
|
Update(r PolicyReport) error
|
||||||
// Remove a PolicyReport with the given Type and ID from the Store
|
// Remove a PolicyReport with the given Type and ID from the Store
|
||||||
Remove(id string) error
|
Remove(id string) error
|
||||||
|
|
Loading…
Reference in a new issue