Skip to content

Commit

Permalink
fix: properly delete rbac and vulnr policy reports (#259)
Browse files Browse the repository at this point in the history
Signed-off-by: Dawid Górski <[email protected]>
  • Loading branch information
Goorsky1 authored Dec 23, 2024
1 parent 8ad620c commit 6b4b203
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/adapters/rbac/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func (e *Client) StartWatching(ctx context.Context) error {
}
},
DeleteFunc: func(ctx context.Context, event event.TypedDeleteEvent[*v1alpha1.RbacAssessmentReport], _ workqueue.TypedRateLimitingInterface[reconcile.Request]) {
err := e.polrClient.GenerateReport(ctx, event.Object)
err := e.polrClient.DeleteReport(ctx, event.Object)
if err != nil {
log.Printf("[ERROR] RbacAssessmentReport: Failed to delete report %s; %s", event.Object.Name, err)
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/adapters/vulnr/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func (e *Client) StartWatching(ctx context.Context) error {
}
},
DeleteFunc: func(ctx context.Context, event event.TypedDeleteEvent[*v1alpha1.VulnerabilityReport], _ workqueue.TypedRateLimitingInterface[reconcile.Request]) {
err := e.polrClient.GenerateReport(ctx, event.Object)
err := e.polrClient.DeleteReport(ctx, event.Object)
if err != nil {
log.Printf("[ERROR] VulnerabilityReport: Failed to delete report %s; %s", event.Object.Name, err)
}
Expand Down

0 comments on commit 6b4b203

Please sign in to comment.