Skip to content

Commit

Permalink
lets use an environment variable to define which variables to watch t…
Browse files Browse the repository at this point in the history
…o reduce the security requirements on openshift
  • Loading branch information
jstrachan committed May 16, 2017
1 parent 5c7e8d8 commit 807e560
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion configmapcontroller.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,15 @@ func main() {
}
}

c, err := controller.NewController(kubeClient, oc, restClientConfig, factory.JSONEncoder(), *resyncPeriod, api.NamespaceAll)
watchNamespaces := api.NamespaceAll
currentNamespace := os.Getenv("KUBERNETES_NAMESPACE")
if len(currentNamespace) > 0 {
watchNamespaces = currentNamespace
}
glog.Infof("Watching services in namespaces: `%s`", watchNamespaces)


c, err := controller.NewController(kubeClient, oc, restClientConfig, factory.JSONEncoder(), *resyncPeriod, watchNamespaces)
if err != nil {
glog.Fatalf("%s", err)
}
Expand Down

0 comments on commit 807e560

Please sign in to comment.