mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-03 17:30:00 +00:00
Remove global variables
This commit is contained in:
parent
2be53cf0f8
commit
70eef5b3e1
@ -26,11 +26,8 @@ import (
|
|||||||
"k8s.io/client-go/tools/clientcmd"
|
"k8s.io/client-go/tools/clientcmd"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
|
||||||
kubeconfig = flag.String("kubeconfig", "./config", "absolute path to the kubeconfig file")
|
|
||||||
)
|
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
kubeconfig := flag.String("kubeconfig", "./config", "absolute path to the kubeconfig file")
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
// uses the current context in kubeconfig
|
// uses the current context in kubeconfig
|
||||||
config, err := clientcmd.BuildConfigFromFlags("", *kubeconfig)
|
config, err := clientcmd.BuildConfigFromFlags("", *kubeconfig)
|
||||||
|
@ -35,10 +35,6 @@ import (
|
|||||||
_ "k8s.io/client-go/plugin/pkg/client/auth/gcp"
|
_ "k8s.io/client-go/plugin/pkg/client/auth/gcp"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
|
||||||
config *rest.Config
|
|
||||||
)
|
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
kubeconfig := flag.String("kubeconfig", "", "Path to a kube config. Only required if out-of-cluster.")
|
kubeconfig := flag.String("kubeconfig", "", "Path to a kube config. Only required if out-of-cluster.")
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
|
Loading…
Reference in New Issue
Block a user