Skip to content
This repository was archived by the owner on Jul 30, 2021. It is now read-only.

✨ Allow restricting namespace for the controller manager #229

Merged
merged 1 commit into from
Sep 14, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ func main() {
metricsAddr string
enableLeaderElection bool
syncPeriod time.Duration
watchNamespace string
)

flag.StringVar(
Expand All @@ -76,6 +77,13 @@ func main() {
"The minimum interval at which watched resources are reconciled (e.g. 10m)",
)

flag.StringVar(
&watchNamespace,
"namespace",
"",
"Namespace that the controller watches to reconcile cluster-api objects. If unspecified, the controller watches for cluster-api objects across all namespaces.",
)

flag.Parse()

ctrl.SetLogger(klogr.New())
Expand All @@ -84,6 +92,7 @@ func main() {
Scheme: scheme,
MetricsBindAddress: metricsAddr,
LeaderElection: enableLeaderElection,
Namespace: watchNamespace,
SyncPeriod: &syncPeriod,
})
if err != nil {
Expand Down