Skip to content

Commit

Permalink
make global vars in the main file private
Browse files Browse the repository at this point in the history
  • Loading branch information
mkabilov committed Aug 1, 2017
1 parent 7914f90 commit e78658b
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions cmd/main.go
Expand Up @@ -13,19 +13,15 @@ import (
)

var (
//KubeConfigFile contains path to the kubernetes cluster config file
KubeConfigFile string

//OutOfCluster denotes if operator is running outside the kubernetes cluster
OutOfCluster bool

version string
config controller.Config
kubeConfigFile string
outOfCluster bool
version string
config controller.Config
)

func init() {
flag.StringVar(&KubeConfigFile, "kubeconfig", "", "Path to kubeconfig file with authorization and master location information.")
flag.BoolVar(&OutOfCluster, "outofcluster", false, "Whether the operator runs in- our outside of the Kubernetes cluster.")
flag.StringVar(&kubeConfigFile, "kubeconfig", "", "Path to kubeconfig file with authorization and master location information.")
flag.BoolVar(&outOfCluster, "outofcluster", false, "Whether the operator runs in- our outside of the Kubernetes cluster.")
flag.BoolVar(&config.NoDatabaseAccess, "nodatabaseaccess", false, "Disable all access to the database from the operator side.")
flag.BoolVar(&config.NoTeamsAPI, "noteamsapi", false, "Disable all access to the teams API")
flag.Parse()
Expand Down Expand Up @@ -56,7 +52,7 @@ func main() {

wg := &sync.WaitGroup{} // Goroutines can add themselves to this to be waited on

config.RestConfig, err = k8sutil.RestConfig(KubeConfigFile, OutOfCluster)
config.RestConfig, err = k8sutil.RestConfig(kubeConfigFile, outOfCluster)
if err != nil {
log.Fatalf("couldn't get REST config: %v", err)
}
Expand Down

0 comments on commit e78658b

Please sign in to comment.