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
0c76c449
Commit
0c76c449
authored
Nov 11, 2014
by
Michal Fojtik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make getKubeConfig public to allow it for external consumption
parent
30fcf241
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
3 deletions
+5
-3
cmd.go
pkg/kubectl/cmd/cmd.go
+4
-2
proxy.go
pkg/kubectl/cmd/proxy.go
+1
-1
No files found.
pkg/kubectl/cmd/cmd.go
View file @
0c76c449
...
@@ -153,7 +153,9 @@ func getExplicitKubeNamespace(cmd *cobra.Command) (string, bool) {
...
@@ -153,7 +153,9 @@ func getExplicitKubeNamespace(cmd *cobra.Command) (string, bool) {
return
""
,
false
return
""
,
false
}
}
func
getKubeConfig
(
cmd
*
cobra
.
Command
)
*
client
.
Config
{
// GetKubeConfig returns a config used for the Kubernetes client with CLI
// options parsed.
func
GetKubeConfig
(
cmd
*
cobra
.
Command
)
*
client
.
Config
{
config
:=
&
client
.
Config
{}
config
:=
&
client
.
Config
{}
var
host
string
var
host
string
...
@@ -203,7 +205,7 @@ func getKubeConfig(cmd *cobra.Command) *client.Config {
...
@@ -203,7 +205,7 @@ func getKubeConfig(cmd *cobra.Command) *client.Config {
}
}
func
getKubeClient
(
cmd
*
cobra
.
Command
)
*
client
.
Client
{
func
getKubeClient
(
cmd
*
cobra
.
Command
)
*
client
.
Client
{
config
:=
g
etKubeConfig
(
cmd
)
config
:=
G
etKubeConfig
(
cmd
)
// The binary version.
// The binary version.
matchVersion
:=
GetFlagBool
(
cmd
,
"match-server-version"
)
matchVersion
:=
GetFlagBool
(
cmd
,
"match-server-version"
)
...
...
pkg/kubectl/cmd/proxy.go
View file @
0c76c449
...
@@ -32,7 +32,7 @@ func NewCmdProxy(out io.Writer) *cobra.Command {
...
@@ -32,7 +32,7 @@ func NewCmdProxy(out io.Writer) *cobra.Command {
Run
:
func
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
Run
:
func
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
port
:=
GetFlagInt
(
cmd
,
"port"
)
port
:=
GetFlagInt
(
cmd
,
"port"
)
glog
.
Infof
(
"Starting to serve on localhost:%d"
,
port
)
glog
.
Infof
(
"Starting to serve on localhost:%d"
,
port
)
server
,
err
:=
kubectl
.
NewProxyServer
(
GetFlagString
(
cmd
,
"www"
),
g
etKubeConfig
(
cmd
),
port
)
server
,
err
:=
kubectl
.
NewProxyServer
(
GetFlagString
(
cmd
,
"www"
),
G
etKubeConfig
(
cmd
),
port
)
checkErr
(
err
)
checkErr
(
err
)
glog
.
Fatal
(
server
.
Serve
())
glog
.
Fatal
(
server
.
Serve
())
},
},
...
...
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