feat: limit control to single current only namespace

This commit is contained in:
2025-01-10 12:30:15 +03:30
parent 0df874b222
commit 4cd00f25f0
4 changed files with 31 additions and 4 deletions

View File

@@ -3,6 +3,7 @@ package crd
import (
"context"
"flink-kube-operator/internal/crd/v1alpha1"
"os"
"flink-kube-operator/pkg"
@@ -20,7 +21,7 @@ func (crd Crd) watchFlinkJobs() rxgo.Observable {
go func() {
pkg.Logger.Debug("[crd] starting watch")
watcher, err := crd.client.Watch(context.Background(), metaV1.ListOptions{})
watcher, err := crd.client.Namespace(os.Getenv("NAMESPACE")).Watch(context.Background(), metaV1.ListOptions{})
if err != nil {
panic(err)
}