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
6b394e72
Commit
6b394e72
authored
Aug 26, 2015
by
feihujiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Kubectl version should show client version at least
when couldn't read server version
parent
00e34429
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
6 deletions
+4
-6
version.go
pkg/kubectl/cmd/version.go
+2
-2
version.go
pkg/kubectl/version.go
+2
-4
No files found.
pkg/kubectl/cmd/version.go
View file @
6b394e72
...
...
@@ -39,8 +39,8 @@ func NewCmdVersion(f *cmdutil.Factory, out io.Writer) *cobra.Command {
}
func
RunVersion
(
f
*
cmdutil
.
Factory
,
out
io
.
Writer
,
cmd
*
cobra
.
Command
)
error
{
if
cmdutil
.
GetFlagBool
(
cmd
,
"client"
)
{
kubectl
.
GetClientVersion
(
out
)
if
cmdutil
.
GetFlagBool
(
cmd
,
"client"
)
{
return
nil
}
...
...
@@ -49,6 +49,6 @@ func RunVersion(f *cmdutil.Factory, out io.Writer, cmd *cobra.Command) error {
return
err
}
kubectl
.
GetVersion
(
out
,
client
)
kubectl
.
Get
Server
Version
(
out
,
client
)
return
nil
}
pkg/kubectl/version.go
View file @
6b394e72
...
...
@@ -25,12 +25,10 @@ import (
"k8s.io/kubernetes/pkg/version"
)
func
GetVersion
(
w
io
.
Writer
,
kubeClient
client
.
Interface
)
{
GetClientVersion
(
w
)
func
GetServerVersion
(
w
io
.
Writer
,
kubeClient
client
.
Interface
)
{
serverVersion
,
err
:=
kubeClient
.
ServerVersion
()
if
err
!=
nil
{
fmt
.
Printf
(
"Couldn't read version from server: %v
\n
"
,
err
)
fmt
.
Printf
(
"Couldn't read
server
version from server: %v
\n
"
,
err
)
os
.
Exit
(
1
)
}
...
...
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