Skip to content

Commit

Permalink
feat(KFLUXBUGS-1162): support override of election leaderId
Browse files Browse the repository at this point in the history
- allows us to have multiple controllers pointing to
  different Konflux instances.

Signed-off-by: Scott Hebert <scoheb@gmail.com>
  • Loading branch information
scoheb committed Mar 25, 2024
1 parent 0b31d94 commit 1a3db8c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,17 @@ func init() {
func main() {
var metricsAddr string
var enableLeaderElection bool
var enableLeaderElectionId string
var probeAddr string
var remoteClusterConfigFile string
flag.StringVar(&metricsAddr, "metrics-bind-address", ":8080", "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,
"Enable leader election for controller manager. "+
"Enabling this will ensure there is only one active controller manager.")
flag.StringVar(&enableLeaderElectionId, "leader-election-id",
"b548bb9d.redhat.com",
"Enable overriding leader election ID for controller manager. ")
flag.StringVar(&remoteClusterConfigFile, "remote-cluster-config-file", "",
"The remote client will load its initial configuration from this file. "+
"Omit this flag to use the default configuration values. "+
Expand All @@ -89,7 +93,7 @@ func main() {
Port: 9443,
HealthProbeBindAddress: probeAddr,
LeaderElection: enableLeaderElection,
LeaderElectionID: "b548bb9d.redhat.com",
LeaderElectionID: enableLeaderElectionId,
NewCache: cache.BuilderWithOptions(cache.Options{
SelectorsByObject: cache.SelectorsByObject{
&tektonv1beta1.PipelineRun{}: {
Expand Down

0 comments on commit 1a3db8c

Please sign in to comment.