Skip to content

Commit

Permalink
Merge pull request #372 from kubescape/feature/commands
Browse files Browse the repository at this point in the history
Adding operatorcommands watcher in namespace
  • Loading branch information
amitschendel authored Sep 22, 2024
2 parents bc87f3b + 855f04d commit de70ad7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/watcher/dynamicwatcher/watch.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@ func (wh *WatchHandler) chooseWatcher(res schema.GroupVersionResource, opts meta
return wh.k8sClient.GetDynamicClient().Resource(res).Namespace("").Watch(context.Background(), opts)
case "seccompprofiles":
return wh.storageClient.SeccompProfiles("").Watch(context.Background(), opts)
case "operatorcommands":
return wh.k8sClient.GetDynamicClient().Resource(res).Namespace("").Watch(context.Background(), opts)
default:
// Make sure the resource version is not our storage, if so we panic.
if res.Group == kubescapeCustomResourceGroup {
Expand Down Expand Up @@ -218,6 +220,8 @@ func (wh *WatchHandler) chooseLister(res schema.GroupVersionResource, opts metav
return wh.k8sClient.GetDynamicClient().Resource(res).Namespace("").List(context.Background(), opts)
case "seccompprofiles":
return wh.storageClient.SeccompProfiles("").List(context.Background(), opts)
case "operatorcommands":
return wh.k8sClient.GetDynamicClient().Resource(res).Namespace("").List(context.Background(), opts)
default:
// Make sure the resource version is not our storage, if so we panic.
if res.Group == kubescapeCustomResourceGroup {
Expand Down

0 comments on commit de70ad7

Please sign in to comment.