Skip to content

Commit 29f1428

Browse files
Merge pull request #404 from ShravaniVangur/revert-353-namespace-4.17
Revert "DFBUGS-2365: [release-4.17] restrict manager to watch selective namespaces"
2 parents 8d8523f + 4d93960 commit 29f1428

File tree

2 files changed

+0
-24
lines changed

2 files changed

+0
-24
lines changed

cmd/main.go

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ package main
1919
import (
2020
"flag"
2121
"os"
22-
"strings"
2322

2423
apiv1alpha1 "github.com/red-hat-storage/ocs-client-operator/api/v1alpha1"
2524
"github.com/red-hat-storage/ocs-client-operator/internal/controller"
@@ -101,20 +100,6 @@ func main() {
101100
ctrl.SetLogger(zap.New(zap.UseFlagOptions(&opts)))
102101

103102
storageclustersSelector := fields.SelectorFromSet(fields.Set{"metadata.name": "storageclusters.ocs.openshift.io"})
104-
105-
defaultNamespaces := map[string]cache.Config{}
106-
operatorNamespace := utils.GetOperatorNamespace()
107-
defaultNamespaces[operatorNamespace] = cache.Config{}
108-
109-
watchNamespace := utils.GetWatchNamespace()
110-
if watchNamespace == "" {
111-
setupLog.Info("No value for env WATCH_NAMESPACE is set. Manager will only watch for resources in the operator deployed namespace.")
112-
} else {
113-
for _, namespace := range strings.Split(watchNamespace, ",") {
114-
defaultNamespaces[namespace] = cache.Config{}
115-
}
116-
}
117-
118103
subscriptionwebhookSelector := fields.SelectorFromSet(fields.Set{"metadata.name": templates.SubscriptionWebhookName})
119104
mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{
120105
Scheme: scheme,
@@ -133,7 +118,6 @@ func main() {
133118
Field: subscriptionwebhookSelector,
134119
},
135120
},
136-
DefaultNamespaces: defaultNamespaces,
137121
},
138122
WebhookServer: webhook.NewServer(webhook.Options{
139123
Port: webhookPort,

pkg/utils/k8sutils.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,6 @@ import (
3030
// which is the namespace where operator pod is deployed.
3131
const OperatorNamespaceEnvVar = "OPERATOR_NAMESPACE"
3232

33-
// WatchNamespaceEnvVar is the constant for env variable WATCH_NAMESPACE
34-
// which indicates any other namespace to watch for resources.
35-
const WatchNamespaceEnvVar = "WATCH_NAMESPACE"
36-
3733
// OperatorPodNameEnvVar is the constant for env variable OPERATOR_POD_NAME
3834
const OperatorPodNameEnvVar = "OPERATOR_POD_NAME"
3935

@@ -59,10 +55,6 @@ func GetOperatorNamespace() string {
5955
return os.Getenv(OperatorNamespaceEnvVar)
6056
}
6157

62-
func GetWatchNamespace() string {
63-
return os.Getenv(WatchNamespaceEnvVar)
64-
}
65-
6658
func ValidateOperatorNamespace() error {
6759
ns := GetOperatorNamespace()
6860
if ns == "" {

0 commit comments

Comments
 (0)