You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: cmd/init-agent/options.go
+9Lines changed: 9 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -43,6 +43,10 @@ type Options struct {
43
43
// manage coordination/v1 leases)
44
44
EnableLeaderElectionbool
45
45
46
+
// LeaderElectionNamespace is the Kubernetes namespace in which the leader
47
+
// election lease will be created.
48
+
LeaderElectionNamespacestring
49
+
46
50
InitTargetSelectorStringstring
47
51
InitTargetSelector labels.Selector
48
52
@@ -66,6 +70,7 @@ func (o *Options) AddFlags(flags *pflag.FlagSet) {
66
70
flags.StringVar(&o.ConfigWorkspace, "config-workspace", o.ConfigWorkspace, "kcp workspace or cluster where the InitTargets live that should be processed")
67
71
flags.StringVar(&o.InitTargetSelectorString, "init-target-selector", o.InitTargetSelectorString, "restrict to only process InitTargets matching this label selector (optional)")
68
72
flags.BoolVar(&o.EnableLeaderElection, "enable-leader-election", o.EnableLeaderElection, "whether to perform leader election")
73
+
flags.StringVar(&o.LeaderElectionNamespace, "leader-election-namespace", o.LeaderElectionNamespace, "Kubernetes namespace for the leader election lease")
69
74
flags.StringVar(&o.MetricsAddr, "metrics-address", o.MetricsAddr, "host and port to serve Prometheus metrics via /metrics (HTTP)")
70
75
flags.StringVar(&o.HealthAddr, "health-address", o.HealthAddr, "host and port to serve probes via /readyz and /healthz (HTTP)")
71
76
}
@@ -81,6 +86,10 @@ func (o *Options) Validate() error {
81
86
errs=append(errs, errors.New("--config-workspace is required"))
0 commit comments