lburgazzoli commented on code in PR #3163:
URL: https://github.com/apache/camel-k/pull/3163#discussion_r841490794


##########
pkg/cmd/operator.go:
##########
@@ -40,16 +41,18 @@ func newCmdOperator() (*cobra.Command, *operatorCmdOptions) 
{
        cmd.Flags().Int32("health-port", 8081, "The port of the health 
endpoint")
        cmd.Flags().Int32("monitoring-port", 8080, "The port of the metrics 
endpoint")
        cmd.Flags().Bool("leader-election", true, "Use leader election")
+       cmd.Flags().String("leader-election-id", platform.OperatorLockName, 
"Use the given id as leader election discriminator")
 
        return &cmd, &options
 }
 
 type operatorCmdOptions struct {
-       HealthPort     int32 `mapstructure:"health-port"`
-       MonitoringPort int32 `mapstructure:"monitoring-port"`
-       LeaderElection bool  `mapstructure:"leader-election"`
+       HealthPort       int32  `mapstructure:"health-port"`
+       MonitoringPort   int32  `mapstructure:"monitoring-port"`
+       LeaderElection   bool   `mapstructure:"leader-election"`
+       LeaderElectionID string `mapstructure:"leader-election-id"`
 }
 
 func (o *operatorCmdOptions) run(_ *cobra.Command, _ []string) {
-       operator.Run(o.HealthPort, o.MonitoringPort, o.LeaderElection)
+       operator.Run(o.HealthPort, o.MonitoringPort, o.LeaderElection, 
o.LeaderElectionID)

Review Comment:
   This should already happen when the flag is initialized, by default it 
should be that value 



-- 
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: dev-unsubscr...@camel.apache.org

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

Reply via email to