@@ -30,19 +30,14 @@ import (
30
30
)
31
31
32
32
var (
33
- kubeconfig , apiServerURL string
34
- log = logf .RuntimeLog .WithName ("client" ).WithName ("config" )
33
+ kubeconfig string
34
+ log = logf .RuntimeLog .WithName ("client" ).WithName ("config" )
35
35
)
36
36
37
37
func init () {
38
38
// TODO: Fix this to allow double vendoring this library but still register flags on behalf of users
39
39
flag .StringVar (& kubeconfig , "kubeconfig" , "" ,
40
40
"Paths to a kubeconfig. Only required if out-of-cluster." )
41
-
42
- // This flag is deprecated, it'll be removed in a future iteration, please switch to --kubeconfig.
43
- flag .StringVar (& apiServerURL , "master" , "" ,
44
- "(Deprecated: switch to `--kubeconfig`) The address of the Kubernetes API server. Overrides any value in kubeconfig. " +
45
- "Only required if out-of-cluster." )
46
41
}
47
42
48
43
// GetConfig creates a *rest.Config for talking to a Kubernetes API server.
@@ -105,7 +100,7 @@ func loadConfig(context string) (*rest.Config, error) {
105
100
106
101
// If a flag is specified with the config location, use that
107
102
if len (kubeconfig ) > 0 {
108
- return loadConfigWithContext (apiServerURL , & clientcmd.ClientConfigLoadingRules {ExplicitPath : kubeconfig }, context )
103
+ return loadConfigWithContext ("" , & clientcmd.ClientConfigLoadingRules {ExplicitPath : kubeconfig }, context )
109
104
}
110
105
111
106
// If the recommended kubeconfig env variable is not specified,
@@ -134,7 +129,7 @@ func loadConfig(context string) (*rest.Config, error) {
134
129
loadingRules .Precedence = append (loadingRules .Precedence , path .Join (u .HomeDir , clientcmd .RecommendedHomeDir , clientcmd .RecommendedFileName ))
135
130
}
136
131
137
- return loadConfigWithContext (apiServerURL , loadingRules , context )
132
+ return loadConfigWithContext ("" , loadingRules , context )
138
133
}
139
134
140
135
func loadConfigWithContext (apiServerURL string , loader clientcmd.ClientConfigLoader , context string ) (* rest.Config , error ) {
0 commit comments