Skip to content

Commit 95c751b

Browse files
Merge pull request #387 from red-hat-storage/revert-352-namespace-4.18
Revert "DFBUGS-2364: [release-4.18] restrict manager to watch selective namespaces"
2 parents d8776ce + 5f29bf3 commit 95c751b

File tree

2 files changed

+0
-23
lines changed

2 files changed

+0
-23
lines changed

cmd/main.go

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import (
2121
"flag"
2222
"fmt"
2323
"os"
24-
"strings"
2524

2625
apiv1alpha1 "github.com/red-hat-storage/ocs-client-operator/api/v1alpha1"
2726
"github.com/red-hat-storage/ocs-client-operator/internal/controller"
@@ -109,19 +108,6 @@ func main() {
109108

110109
ctrl.SetLogger(zap.New(zap.UseFlagOptions(&opts)))
111110

112-
defaultNamespaces := map[string]cache.Config{}
113-
operatorNamespace := utils.GetOperatorNamespace()
114-
defaultNamespaces[operatorNamespace] = cache.Config{}
115-
116-
watchNamespace := utils.GetWatchNamespace()
117-
if watchNamespace == "" {
118-
setupLog.Info("No value for env WATCH_NAMESPACE is set. Manager will only watch for resources in the operator deployed namespace.")
119-
} else {
120-
for _, namespace := range strings.Split(watchNamespace, ",") {
121-
defaultNamespaces[namespace] = cache.Config{}
122-
}
123-
}
124-
125111
subscriptionwebhookSelector := fields.SelectorFromSet(fields.Set{"metadata.name": templates.SubscriptionWebhookName})
126112
mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{
127113
Scheme: scheme,
@@ -136,7 +122,6 @@ func main() {
136122
Field: subscriptionwebhookSelector,
137123
},
138124
},
139-
DefaultNamespaces: defaultNamespaces,
140125
},
141126
WebhookServer: webhook.NewServer(webhook.Options{
142127
Port: webhookPort,

pkg/utils/k8sutils.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,6 @@ const (
3737
// which is the namespace where operator pod is deployed.
3838
OperatorNamespaceEnvVar = "OPERATOR_NAMESPACE"
3939

40-
// WatchNamespaceEnvVar is the constant for env variable WATCH_NAMESPACE
41-
// which indicates any other namespace to watch for resources.
42-
WatchNamespaceEnvVar = "WATCH_NAMESPACE"
43-
4440
// OperatorPodNameEnvVar is the constant for env variable OPERATOR_POD_NAME
4541
OperatorPodNameEnvVar = "OPERATOR_POD_NAME"
4642

@@ -67,10 +63,6 @@ func GetOperatorNamespace() string {
6763
return os.Getenv(OperatorNamespaceEnvVar)
6864
}
6965

70-
func GetWatchNamespace() string {
71-
return os.Getenv(WatchNamespaceEnvVar)
72-
}
73-
7466
func ValidateOperatorNamespace() error {
7567
ns := GetOperatorNamespace()
7668
if ns == "" {

0 commit comments

Comments
 (0)