This is an automated email from the ASF dual-hosted git repository.
roryqi pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-uniffle.git
The following commit(s) were added to refs/heads/master by this push:
new 87ee4d42e [#1182] fix(operator): The LeaderElectionNamespace of the
rss-controller is hard-coded to kube-system. (#1183)
87ee4d42e is described below
commit 87ee4d42ee65d69deb8038bbfe4fd313db5e5d1b
Author: QI Jiale <[email protected]>
AuthorDate: Sun Sep 3 12:34:22 2023 +0800
[#1182] fix(operator): The LeaderElectionNamespace of the rss-controller is
hard-coded to kube-system. (#1183)
### What changes were proposed in this pull request?
get namespace from user configuration
### Why are the changes needed?
Fix: #1182
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
Tested in our cluster.
---
deploy/kubernetes/operator/pkg/controller/config/config.go | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/deploy/kubernetes/operator/pkg/controller/config/config.go
b/deploy/kubernetes/operator/pkg/controller/config/config.go
index 3839fc165..f95f4f448 100644
--- a/deploy/kubernetes/operator/pkg/controller/config/config.go
+++ b/deploy/kubernetes/operator/pkg/controller/config/config.go
@@ -58,7 +58,7 @@ func (c *Config) AddFlags() {
flag.IntVar(&c.Workers, flagWorkers, 1, "Concurrency of the rss
controller.")
flag.BoolVar(&c.ManagerOptions.LeaderElection, managerLeaderElection,
true, "LeaderElection determines whether or not to use leader election when
starting the manager.")
flag.StringVar(&c.ManagerOptions.LeaderElectionID,
managerLeaderElectionID, c.LeaderElectionID(), "LeaderElectionID determines the
name of the resource that leader election will use for holding the leader
lock.")
- flag.StringVar(&c.ManagerOptions.LeaderElectionNamespace,
managerLeaderElectionNamespace, "kube-system", "LeaderElectionNamespace
determines the namespace in which the leader election resource will be
created.")
+ flag.StringVar(&c.ManagerOptions.LeaderElectionNamespace,
managerLeaderElectionNamespace, utils.GetCurrentNamespace(),
"LeaderElectionNamespace determines the namespace in which the leader election
resource will be created.")
flag.StringVar(&c.ManagerOptions.Namespace, managerNamespace, "",
"Namespace if specified restricts the manager's cache to watch objects in the
desired namespace Defaults to all namespaces.")
flag.DurationVar(c.ManagerOptions.SyncPeriod, managerSyncPeriod,
time.Hour*10, "SyncPeriod determines the minimum frequency at which watched
resources are reconciled.")
flag.DurationVar(c.ManagerOptions.RetryPeriod, managerRetryPeriod,
time.Second*2, "RetryPeriod is the duration the LeaderElector clients should
wait between tries of actions.")