Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
75bd27a5
Commit
75bd27a5
authored
May 12, 2017
by
deads2k
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove unnessary confusion of dead values
parent
e401dc74
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
5 additions
and
34 deletions
+5
-34
create_cluster.go
pkg/kubectl/cmd/config/create_cluster.go
+0
-5
clientcache.go
pkg/kubectl/cmd/util/clientcache.go
+1
-7
types.go
staging/src/k8s.io/client-go/tools/clientcmd/api/types.go
+2
-8
types.go
staging/src/k8s.io/client-go/tools/clientcmd/api/v1/types.go
+2
-8
overrides.go
staging/src/k8s.io/client-go/tools/clientcmd/overrides.go
+0
-3
apiserver_test.go
test/integration/examples/apiserver_test.go
+0
-3
No files found.
pkg/kubectl/cmd/config/create_cluster.go
View file @
75bd27a5
...
@@ -37,7 +37,6 @@ type createClusterOptions struct {
...
@@ -37,7 +37,6 @@ type createClusterOptions struct {
configAccess
clientcmd
.
ConfigAccess
configAccess
clientcmd
.
ConfigAccess
name
string
name
string
server
flag
.
StringFlag
server
flag
.
StringFlag
apiVersion
flag
.
StringFlag
insecureSkipTLSVerify
flag
.
Tristate
insecureSkipTLSVerify
flag
.
Tristate
certificateAuthority
flag
.
StringFlag
certificateAuthority
flag
.
StringFlag
embedCAData
flag
.
Tristate
embedCAData
flag
.
Tristate
...
@@ -78,7 +77,6 @@ func NewCmdConfigSetCluster(out io.Writer, configAccess clientcmd.ConfigAccess)
...
@@ -78,7 +77,6 @@ func NewCmdConfigSetCluster(out io.Writer, configAccess clientcmd.ConfigAccess)
options
.
insecureSkipTLSVerify
.
Default
(
false
)
options
.
insecureSkipTLSVerify
.
Default
(
false
)
cmd
.
Flags
()
.
Var
(
&
options
.
server
,
clientcmd
.
FlagAPIServer
,
clientcmd
.
FlagAPIServer
+
" for the cluster entry in kubeconfig"
)
cmd
.
Flags
()
.
Var
(
&
options
.
server
,
clientcmd
.
FlagAPIServer
,
clientcmd
.
FlagAPIServer
+
" for the cluster entry in kubeconfig"
)
cmd
.
Flags
()
.
Var
(
&
options
.
apiVersion
,
clientcmd
.
FlagAPIVersion
,
clientcmd
.
FlagAPIVersion
+
" for the cluster entry in kubeconfig"
)
f
:=
cmd
.
Flags
()
.
VarPF
(
&
options
.
insecureSkipTLSVerify
,
clientcmd
.
FlagInsecure
,
""
,
clientcmd
.
FlagInsecure
+
" for the cluster entry in kubeconfig"
)
f
:=
cmd
.
Flags
()
.
VarPF
(
&
options
.
insecureSkipTLSVerify
,
clientcmd
.
FlagInsecure
,
""
,
clientcmd
.
FlagInsecure
+
" for the cluster entry in kubeconfig"
)
f
.
NoOptDefVal
=
"true"
f
.
NoOptDefVal
=
"true"
cmd
.
Flags
()
.
Var
(
&
options
.
certificateAuthority
,
clientcmd
.
FlagCAFile
,
"path to "
+
clientcmd
.
FlagCAFile
+
" file for the cluster entry in kubeconfig"
)
cmd
.
Flags
()
.
Var
(
&
options
.
certificateAuthority
,
clientcmd
.
FlagCAFile
,
"path to "
+
clientcmd
.
FlagCAFile
+
" file for the cluster entry in kubeconfig"
)
...
@@ -118,9 +116,6 @@ func (o createClusterOptions) run() error {
...
@@ -118,9 +116,6 @@ func (o createClusterOptions) run() error {
func
(
o
*
createClusterOptions
)
modifyCluster
(
existingCluster
clientcmdapi
.
Cluster
)
clientcmdapi
.
Cluster
{
func
(
o
*
createClusterOptions
)
modifyCluster
(
existingCluster
clientcmdapi
.
Cluster
)
clientcmdapi
.
Cluster
{
modifiedCluster
:=
existingCluster
modifiedCluster
:=
existingCluster
if
o
.
apiVersion
.
Provided
()
{
modifiedCluster
.
APIVersion
=
o
.
apiVersion
.
Value
()
}
if
o
.
server
.
Provided
()
{
if
o
.
server
.
Provided
()
{
modifiedCluster
.
Server
=
o
.
server
.
Value
()
modifiedCluster
.
Server
=
o
.
server
.
Value
()
}
}
...
...
pkg/kubectl/cmd/util/clientcache.go
View file @
75bd27a5
...
@@ -103,14 +103,8 @@ func (c *ClientCache) clientConfigForVersion(requiredVersion *schema.GroupVersio
...
@@ -103,14 +103,8 @@ func (c *ClientCache) clientConfigForVersion(requiredVersion *schema.GroupVersio
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
}
}
if
requiredVersion
==
nil
&&
config
.
GroupVersion
!=
nil
{
// if someone has set the values via flags, our config will have the groupVersion set
// that means it is required.
requiredVersion
=
config
.
GroupVersion
}
// required version may still be nil, since config.GroupVersion may have been nil. Do the check
// only lookup in the cache if the requiredVersion is set
// before looking up from the cache
if
requiredVersion
!=
nil
{
if
requiredVersion
!=
nil
{
if
config
,
ok
:=
c
.
configs
[
*
requiredVersion
];
ok
{
if
config
,
ok
:=
c
.
configs
[
*
requiredVersion
];
ok
{
return
copyConfig
(
config
),
nil
return
copyConfig
(
config
),
nil
...
...
staging/src/k8s.io/client-go/tools/clientcmd/api/types.go
View file @
75bd27a5
...
@@ -30,11 +30,8 @@ type Config struct {
...
@@ -30,11 +30,8 @@ type Config struct {
// TODO(jlowdermilk): remove this after eliminating downstream dependencies.
// TODO(jlowdermilk): remove this after eliminating downstream dependencies.
// +optional
// +optional
Kind
string
`json:"kind,omitempty"`
Kind
string
`json:"kind,omitempty"`
// DEPRECATED: APIVersion is the preferred api version for communicating with the kubernetes cluster (v1, v2, etc).
// Legacy field from pkg/api/types.go TypeMeta.
// Because a cluster can run multiple API groups and potentially multiple versions of each, it no longer makes sense to specify
// TODO(jlowdermilk): remove this after eliminating downstream dependencies.
// a single value for the cluster version.
// This field isn't really needed anyway, so we are deprecating it without replacement.
// It will be ignored if it is present.
// +optional
// +optional
APIVersion
string
`json:"apiVersion,omitempty"`
APIVersion
string
`json:"apiVersion,omitempty"`
// Preferences holds general information to be use for cli interactions
// Preferences holds general information to be use for cli interactions
...
@@ -67,9 +64,6 @@ type Cluster struct {
...
@@ -67,9 +64,6 @@ type Cluster struct {
LocationOfOrigin
string
LocationOfOrigin
string
// Server is the address of the kubernetes cluster (https://hostname:port).
// Server is the address of the kubernetes cluster (https://hostname:port).
Server
string
`json:"server"`
Server
string
`json:"server"`
// APIVersion is the preferred api version for communicating with the kubernetes cluster (v1, v2, etc).
// +optional
APIVersion
string
`json:"api-version,omitempty"`
// InsecureSkipTLSVerify skips the validity check for the server's certificate. This will make your HTTPS connections insecure.
// InsecureSkipTLSVerify skips the validity check for the server's certificate. This will make your HTTPS connections insecure.
// +optional
// +optional
InsecureSkipTLSVerify
bool
`json:"insecure-skip-tls-verify,omitempty"`
InsecureSkipTLSVerify
bool
`json:"insecure-skip-tls-verify,omitempty"`
...
...
staging/src/k8s.io/client-go/tools/clientcmd/api/v1/types.go
View file @
75bd27a5
...
@@ -29,11 +29,8 @@ type Config struct {
...
@@ -29,11 +29,8 @@ type Config struct {
// TODO(jlowdermilk): remove this after eliminating downstream dependencies.
// TODO(jlowdermilk): remove this after eliminating downstream dependencies.
// +optional
// +optional
Kind
string
`json:"kind,omitempty"`
Kind
string
`json:"kind,omitempty"`
// DEPRECATED: APIVersion is the preferred api version for communicating with the kubernetes cluster (v1, v2, etc).
// Legacy field from pkg/api/types.go TypeMeta.
// Because a cluster can run multiple API groups and potentially multiple versions of each, it no longer makes sense to specify
// TODO(jlowdermilk): remove this after eliminating downstream dependencies.
// a single value for the cluster version.
// This field isn't really needed anyway, so we are deprecating it without replacement.
// It will be ignored if it is present.
// +optional
// +optional
APIVersion
string
`json:"apiVersion,omitempty"`
APIVersion
string
`json:"apiVersion,omitempty"`
// Preferences holds general information to be use for cli interactions
// Preferences holds general information to be use for cli interactions
...
@@ -63,9 +60,6 @@ type Preferences struct {
...
@@ -63,9 +60,6 @@ type Preferences struct {
type
Cluster
struct
{
type
Cluster
struct
{
// Server is the address of the kubernetes cluster (https://hostname:port).
// Server is the address of the kubernetes cluster (https://hostname:port).
Server
string
`json:"server"`
Server
string
`json:"server"`
// APIVersion is the preferred api version for communicating with the kubernetes cluster (v1, v2, etc).
// +optional
APIVersion
string
`json:"api-version,omitempty"`
// InsecureSkipTLSVerify skips the validity check for the server's certificate. This will make your HTTPS connections insecure.
// InsecureSkipTLSVerify skips the validity check for the server's certificate. This will make your HTTPS connections insecure.
// +optional
// +optional
InsecureSkipTLSVerify
bool
`json:"insecure-skip-tls-verify,omitempty"`
InsecureSkipTLSVerify
bool
`json:"insecure-skip-tls-verify,omitempty"`
...
...
staging/src/k8s.io/client-go/tools/clientcmd/overrides.go
View file @
75bd27a5
...
@@ -216,9 +216,6 @@ func BindAuthInfoFlags(authInfo *clientcmdapi.AuthInfo, flags *pflag.FlagSet, fl
...
@@ -216,9 +216,6 @@ func BindAuthInfoFlags(authInfo *clientcmdapi.AuthInfo, flags *pflag.FlagSet, fl
// BindClusterFlags is a convenience method to bind the specified flags to their associated variables
// BindClusterFlags is a convenience method to bind the specified flags to their associated variables
func
BindClusterFlags
(
clusterInfo
*
clientcmdapi
.
Cluster
,
flags
*
pflag
.
FlagSet
,
flagNames
ClusterOverrideFlags
)
{
func
BindClusterFlags
(
clusterInfo
*
clientcmdapi
.
Cluster
,
flags
*
pflag
.
FlagSet
,
flagNames
ClusterOverrideFlags
)
{
flagNames
.
APIServer
.
BindStringFlag
(
flags
,
&
clusterInfo
.
Server
)
flagNames
.
APIServer
.
BindStringFlag
(
flags
,
&
clusterInfo
.
Server
)
// TODO: remove --api-version flag in 1.3.
flagNames
.
APIVersion
.
BindStringFlag
(
flags
,
&
clusterInfo
.
APIVersion
)
flags
.
MarkDeprecated
(
FlagAPIVersion
,
"flag is no longer respected and will be deleted in the next release"
)
flagNames
.
CertificateAuthority
.
BindStringFlag
(
flags
,
&
clusterInfo
.
CertificateAuthority
)
flagNames
.
CertificateAuthority
.
BindStringFlag
(
flags
,
&
clusterInfo
.
CertificateAuthority
)
flagNames
.
InsecureSkipTLSVerify
.
BindBoolFlag
(
flags
,
&
clusterInfo
.
InsecureSkipTLSVerify
)
flagNames
.
InsecureSkipTLSVerify
.
BindBoolFlag
(
flags
,
&
clusterInfo
.
InsecureSkipTLSVerify
)
}
}
...
...
test/integration/examples/apiserver_test.go
View file @
75bd27a5
...
@@ -378,9 +378,6 @@ func createKubeConfig(clientCfg *rest.Config) *clientcmdapi.Config {
...
@@ -378,9 +378,6 @@ func createKubeConfig(clientCfg *rest.Config) *clientcmdapi.Config {
cluster
.
CertificateAuthorityData
=
clientCfg
.
CAData
cluster
.
CertificateAuthorityData
=
clientCfg
.
CAData
}
}
cluster
.
InsecureSkipTLSVerify
=
clientCfg
.
Insecure
cluster
.
InsecureSkipTLSVerify
=
clientCfg
.
Insecure
if
clientCfg
.
GroupVersion
!=
nil
{
cluster
.
APIVersion
=
clientCfg
.
GroupVersion
.
String
()
}
config
.
Clusters
[
clusterNick
]
=
cluster
config
.
Clusters
[
clusterNick
]
=
cluster
context
:=
clientcmdapi
.
NewContext
()
context
:=
clientcmdapi
.
NewContext
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment