Skip to content

Commit 2691877

Browse files
committed
remove watch for the storage client
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
1 parent 39d5448 commit 2691877

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

pkg/watcher/dynamicwatcher/watch.go

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -134,12 +134,6 @@ func (wh *WatchHandler) Stop(_ context.Context) {
134134

135135
func (wh *WatchHandler) chooseWatcher(res schema.GroupVersionResource, opts metav1.ListOptions) (watch.Interface, error) {
136136
switch res.Resource {
137-
case "applicationprofiles":
138-
opts.ResourceVersion = softwarecomposition.ResourceVersionFullSpec
139-
return wh.storageClient.ApplicationProfiles("").Watch(context.Background(), opts)
140-
case "networkneighborhoods":
141-
opts.ResourceVersion = softwarecomposition.ResourceVersionFullSpec
142-
return wh.storageClient.NetworkNeighborhoods("").Watch(context.Background(), opts)
143137
case "pods":
144138
return wh.k8sClient.GetKubernetesClient().CoreV1().Pods("").Watch(context.Background(), opts)
145139
case "runtimerulealertbindings":
@@ -152,7 +146,7 @@ func (wh *WatchHandler) chooseWatcher(res schema.GroupVersionResource, opts meta
152146
default:
153147
// Make sure the resource version is not our storage, if so we panic.
154148
if res.Group == kubescapeCustomResourceGroup {
155-
return nil, fmt.Errorf("resource must use the storage client %s: %w", res.Resource, errNotImplemented)
149+
return nil, fmt.Errorf("watch is not implemented by the kubescape storage client %s: %w", res.Resource, errNotImplemented)
156150
}
157151

158152
return wh.k8sClient.GetDynamicClient().Resource(res).Watch(context.Background(), opts)

0 commit comments

Comments
 (0)