Use TPR object namespace while creating its objects

This commit is contained in:
Murat Kabilov
2017-05-12 11:37:09 +02:00
parent 9169808133
commit dfde075c66
6 changed files with 58 additions and 47 deletions
+5 -5
View File
@@ -16,7 +16,7 @@ import (
var (
KubeConfigFile string
Namespace string
podNamespace string
OutOfCluster bool
version string
)
@@ -26,9 +26,9 @@ func init() {
flag.BoolVar(&OutOfCluster, "outofcluster", false, "Whether the operator runs in- our outside of the Kubernetes cluster.")
flag.Parse()
Namespace = os.Getenv("MY_POD_NAMESPACE")
if len(Namespace) == 0 {
Namespace = "default"
podNamespace = os.Getenv("MY_POD_NAMESPACE")
if len(podNamespace) == 0 {
podNamespace = "default"
}
}
@@ -47,7 +47,7 @@ func ControllerConfig() *controller.Config {
teamsApi := teams.NewTeamsAPI(constants.TeamsAPIUrl)
return &controller.Config{
Namespace: Namespace,
PodNamespace: podNamespace,
KubeClient: client,
RestClient: restClient,
TeamsAPIClient: teamsApi,