Skip to content

Commit b194e87

Browse files
committed
Master -> Control Plane
Signed-off-by: Vince Prignano <[email protected]>
1 parent 752e0b5 commit b194e87

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

pkg/client/config/config.go

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,21 +29,22 @@ import (
2929
)
3030

3131
var (
32-
kubeconfig, masterURL string
33-
log = logf.RuntimeLog.WithName("client").WithName("config")
32+
kubeconfig, controlPlaneURL string
33+
log = logf.RuntimeLog.WithName("client").WithName("config")
3434
)
3535

3636
func init() {
3737
// TODO: Fix this to allow double vendoring this library but still register flags on behalf of users
3838
flag.StringVar(&kubeconfig, "kubeconfig", "",
3939
"Paths to a kubeconfig. Only required if out-of-cluster.")
4040

41-
flag.StringVar(&masterURL, "master", "",
42-
"The address of the Kubernetes API server. Overrides any value in kubeconfig. "+
41+
// This flag is deprecated, it'll be removed in a future iteration, please switch to --kubeconfig.
42+
flag.StringVar(&controlPlaneURL, "master", "",
43+
"(Deprecated: switch to `--kubeconfig`) The address of the Kubernetes API server. Overrides any value in kubeconfig. "+
4344
"Only required if out-of-cluster.")
4445
}
4546

46-
// GetConfig creates a *rest.Config for talking to a Kubernetes apiserver.
47+
// GetConfig creates a *rest.Config for talking to a Kubernetes API server.
4748
// If --kubeconfig is set, will use the kubeconfig file at that location. Otherwise will assume running
4849
// in cluster and use the cluster provided kubeconfig.
4950
//
@@ -59,11 +60,11 @@ func init() {
5960
func GetConfig() (*rest.Config, error) {
6061
// If a flag is specified with the config location, use that
6162
if len(kubeconfig) > 0 {
62-
return clientcmd.BuildConfigFromFlags(masterURL, kubeconfig)
63+
return clientcmd.BuildConfigFromFlags(controlPlaneURL, kubeconfig)
6364
}
6465
// If an env variable is specified with the config locaiton, use that
6566
if len(os.Getenv("KUBECONFIG")) > 0 {
66-
return clientcmd.BuildConfigFromFlags(masterURL, os.Getenv("KUBECONFIG"))
67+
return clientcmd.BuildConfigFromFlags(controlPlaneURL, os.Getenv("KUBECONFIG"))
6768
}
6869
// If no explicit location, try the in-cluster config
6970
if c, err := rest.InClusterConfig(); err == nil {

0 commit comments

Comments
 (0)