You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@uniffle.apache.org by "advancedxy (via GitHub)" <gi...@apache.org> on 2023/03/01 09:29:38 UTC

[GitHub] [incubator-uniffle] advancedxy commented on a diff in pull request #670: [#645][Improvement] feat(operator): support manager parameter configuration

advancedxy commented on code in PR #670:
URL: https://github.com/apache/incubator-uniffle/pull/670#discussion_r1121404618


##########
deploy/kubernetes/operator/pkg/controller/config/config.go:
##########
@@ -42,6 +54,15 @@ func (c *Config) LeaderElectionID() string {
 // AddFlags adds all configurations to the global flags.
 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.")

Review Comment:
   @wangao1236 could you help check this default values is proper or not?



##########
deploy/kubernetes/operator/cmd/controller/main.go:
##########
@@ -30,17 +30,15 @@ import (
 func main() {
 	klog.InitFlags(nil)
 	cfg := &config.Config{}
+	cfg.ManagerOptions = ctrl.Options{}

Review Comment:
   is this necessary?



##########
deploy/kubernetes/operator/pkg/controller/config/config.go:
##########
@@ -42,6 +54,15 @@ func (c *Config) LeaderElectionID() string {
 // AddFlags adds all configurations to the global flags.
 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.Namespace, managerNamespace, "", "Namespace if specified restricts the manager's cache to watch objects in the desired namespace Defaults to all namespaces.")
+	flag.DurationVar(&syncPeriod, managerSyncPeriod, time.Hour*10, "SyncPeriod determines the minimum frequency at which watched resources are reconciled.")

Review Comment:
   is this necessary?  is `flag.DurationVar(c.ManagerOptions.SyncPeriod)` doesn't work?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org