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

Commit 46acfbd

Browse files
authored
Merge pull request #229 from detiber/restrictNamespace
✨ Allow restricting namespace for the controller manager
2 parents 093a241 + 577923b commit 46acfbd

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

main.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ func main() {
5353
metricsAddr string
5454
enableLeaderElection bool
5555
syncPeriod time.Duration
56+
watchNamespace string
5657
)
5758

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

80+
flag.StringVar(
81+
&watchNamespace,
82+
"namespace",
83+
"",
84+
"Namespace that the controller watches to reconcile cluster-api objects. If unspecified, the controller watches for cluster-api objects across all namespaces.",
85+
)
86+
7987
flag.Parse()
8088

8189
ctrl.SetLogger(klogr.New())
@@ -84,6 +92,7 @@ func main() {
8492
Scheme: scheme,
8593
MetricsBindAddress: metricsAddr,
8694
LeaderElection: enableLeaderElection,
95+
Namespace: watchNamespace,
8796
SyncPeriod: &syncPeriod,
8897
})
8998
if err != nil {

0 commit comments

Comments
 (0)