Skip to content

Commit

Permalink
Allow to more granular namespace watch
Browse files Browse the repository at this point in the history
  • Loading branch information
AustinLMayes committed Apr 5, 2024
1 parent 9136b2a commit d59f946
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmd/operator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
dorisv1 "github.com/selectdb/doris-operator/api/doris/v1"
"github.com/selectdb/doris-operator/pkg/controller"
"io"
v12 "k8s.io/apimachinery/pkg/apis/meta/v1"
"os"

// Import all Kubernetes client auth plugins (e.g. Azure, GCP, OIDC, etc.)
Expand Down Expand Up @@ -69,8 +70,10 @@ func main() {
var metricsAddr string
var enableLeaderElection bool
var probeAddr string
var namespace 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.StringVar(&namespace, "namespace", v12.NamespaceAll, "The namespace to watch for changes.")
flag.BoolVar(&enableLeaderElection, "leader-elect", true,
"Enable leader election for controller manager. "+
"Enabling this will ensure there is only one active controller manager.")
Expand All @@ -93,6 +96,7 @@ func main() {
MetricsBindAddress: metricsAddr,
Port: 9443,
HealthProbeBindAddress: probeAddr,
Namespace: namespace,
LeaderElection: enableLeaderElection,
LeaderElectionID: "e1370669.selectdb.com",
// LeaderElectionReleaseOnCancel defines if the leader should step down voluntarily
Expand Down

0 comments on commit d59f946

Please sign in to comment.