This is an automated email from the ASF dual-hosted git repository.
caigy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/rocketmq-operator.git
The following commit(s) were added to refs/heads/master by this push:
new dd4ec64 Support operator watch specify namespace (#180)
dd4ec64 is described below
commit dd4ec64888f509a3f4382262b521e61b461c0854
Author: yangw <[email protected]>
AuthorDate: Fri Sep 22 19:00:25 2023 +0800
Support operator watch specify namespace (#180)
---
main.go | 3 +++
1 file changed, 3 insertions(+)
diff --git a/main.go b/main.go
index 7aae21a..c0196a0 100644
--- a/main.go
+++ b/main.go
@@ -61,6 +61,8 @@ func main() {
var metricsAddr string
var enableLeaderElection bool
var probeAddr string
+ var watchNamespace string
+ flag.StringVar(&watchNamespace, "watch-namespace",
os.Getenv("WATCH_NAMESPACE"), "The namespace to watch, if not specified, all
namespaces will be watched")
flag.StringVar(&metricsAddr, "metrics-bind-address", ":8383", "The
address the metric endpoint binds to.")
flag.StringVar(&probeAddr, "health-probe-bind-address", ":8081", "The
address the probe endpoint binds to.")
flag.BoolVar(&enableLeaderElection, "leader-elect", false,
@@ -81,6 +83,7 @@ func main() {
HealthProbeBindAddress: probeAddr,
LeaderElection: enableLeaderElection,
LeaderElectionID: "2516c052.apache.org",
+ Namespace: watchNamespace,
})
if err != nil {
setupLog.Error(err, "unable to start manager")