Remove global variables

This commit is contained in:
Mikhail Mazurskiy 2017-02-08 21:54:40 +11:00
parent 2be53cf0f8
commit 70eef5b3e1
No known key found for this signature in database
GPG Key ID: 93551ECC96E2F568
2 changed files with 1 additions and 8 deletions

View File

@ -26,11 +26,8 @@ import (
"k8s.io/client-go/tools/clientcmd"
)
var (
kubeconfig = flag.String("kubeconfig", "./config", "absolute path to the kubeconfig file")
)
func main() {
kubeconfig := flag.String("kubeconfig", "./config", "absolute path to the kubeconfig file")
flag.Parse()
// uses the current context in kubeconfig
config, err := clientcmd.BuildConfigFromFlags("", *kubeconfig)

View File

@ -35,10 +35,6 @@ import (
_ "k8s.io/client-go/plugin/pkg/client/auth/gcp"
)
var (
config *rest.Config
)
func main() {
kubeconfig := flag.String("kubeconfig", "", "Path to a kube config. Only required if out-of-cluster.")
flag.Parse()