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

Commit

Permalink
Merge pull request #229 from detiber/restrictNamespace
Browse files Browse the repository at this point in the history
✨ Allow restricting namespace for the controller manager
  • Loading branch information
k8s-ci-robot committed Sep 14, 2019
2 parents 093a241 + 577923b commit 46acfbd
Showing 1 changed file with 9 additions and 0 deletions.
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

0 comments on commit 46acfbd

Please sign in to comment.