You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uniffle.apache.org by ro...@apache.org on 2023/10/17 11:26:51 UTC
[incubator-uniffle] 01/05: [#1182] fix(operator): The LeaderElectionNamespace of the rss-controller is hard-coded to kube-system. (#1183)
This is an automated email from the ASF dual-hosted git repository.
roryqi pushed a commit to branch branch-0.8
in repository https://gitbox.apache.org/repos/asf/incubator-uniffle.git
commit 2512ccda4612143668b1afe3834b28b095a1661b
Author: QI Jiale <qi...@foxmail.com>
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.")