Skip to content

Commit

Permalink
fix skip namespace logic so that kubescape.io resources are not skipp…
Browse files Browse the repository at this point in the history
…ed (#373)

Signed-off-by: Amir Malka <[email protected]>
  • Loading branch information
amirmalka authored Sep 22, 2024
1 parent de70ad7 commit 3d4f685
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/watcher/dynamicwatcher/watch.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,8 @@ func (wh *WatchHandler) watchRetry(ctx context.Context, res schema.GroupVersionR
return fmt.Errorf("watch error: %s", event.Object)
}
obj := event.Object.(metav1.Object)
if wh.skipNamespaceFunc(obj.GetNamespace()) {
// we don't want to skip kubescape.io resources (CRDs). @amirmalka @amitschendel
if res.Group != "kubescape.io" && wh.skipNamespaceFunc(obj.GetNamespace()) {
continue
}
eventQueue.Enqueue(event)
Expand Down

0 comments on commit 3d4f685

Please sign in to comment.