Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
H
helm3
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
helm3
Commits
47398de7
Commit
47398de7
authored
Jun 21, 2016
by
Adam Reese
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(tunnel): allow tunneling to non-default namespace
parent
46501db5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
9 deletions
+10
-9
helm.go
cmd/helm/helm.go
+7
-4
init.go
cmd/helm/init.go
+0
-2
tunnel.go
cmd/helm/tunnel.go
+3
-3
No files found.
cmd/helm/helm.go
View file @
47398de7
...
...
@@ -17,8 +17,11 @@ const (
hostEnvVar
=
"HELM_HOST"
)
var
helmHome
string
var
tillerHost
string
var
(
helmHome
string
tillerHost
string
tillerNamespace
string
)
// flagDebug is a signal that the user wants additional output.
var
flagDebug
bool
...
...
@@ -61,6 +64,7 @@ func init() {
p
:=
RootCommand
.
PersistentFlags
()
p
.
StringVar
(
&
helmHome
,
"home"
,
home
,
"location of your Helm config. Overrides $HELM_HOME."
)
p
.
StringVar
(
&
tillerHost
,
"host"
,
thost
,
"address of tiller. Overrides $HELM_HOST."
)
p
.
StringVarP
(
&
tillerNamespace
,
"namespace"
,
"n"
,
""
,
"kubernetes namespace"
)
p
.
BoolVarP
(
&
flagDebug
,
"debug"
,
""
,
false
,
"enable verbose output"
)
}
...
...
@@ -72,8 +76,7 @@ func main() {
func
setupConnection
(
c
*
cobra
.
Command
,
args
[]
string
)
error
{
if
tillerHost
==
""
{
// Should failure fall back to default host?
tunnel
,
err
:=
newTillerPortForwarder
()
tunnel
,
err
:=
newTillerPortForwarder
(
tillerNamespace
)
if
err
!=
nil
{
return
err
}
...
...
cmd/helm/init.go
View file @
47398de7
...
...
@@ -17,7 +17,6 @@ Kubernetes Cluster and sets up local configuration in $HELM_HOME (default: ~/.he
var
(
tillerImg
string
tillerNamespace
string
clientOnly
bool
initSkipNamespace
bool
defaultRepository
=
"kubernetes-charts"
...
...
@@ -29,7 +28,6 @@ func init() {
f
.
StringVarP
(
&
tillerImg
,
"tiller-image"
,
"i"
,
""
,
"override tiller image"
)
f
.
BoolVarP
(
&
clientOnly
,
"client-only"
,
"c"
,
false
,
"If set does not install tiller"
)
f
.
BoolVarP
(
&
initSkipNamespace
,
"skip-namespace"
,
"s"
,
false
,
"Do not attempt to create a namespace. Assume the namespace is already there."
)
f
.
StringVarP
(
&
tillerNamespace
,
"namespace"
,
"n"
,
"helm"
,
"set the tiller namespace"
)
RootCommand
.
AddCommand
(
initCmd
)
}
...
...
cmd/helm/tunnel.go
View file @
47398de7
...
...
@@ -12,14 +12,14 @@ import (
// TODO refactor out this global var
var
tunnel
*
kube
.
Tunnel
func
newTillerPortForwarder
()
(
*
kube
.
Tunnel
,
error
)
{
podName
,
err
:=
getTillerPodName
(
"helm"
)
func
newTillerPortForwarder
(
namespace
string
)
(
*
kube
.
Tunnel
,
error
)
{
podName
,
err
:=
getTillerPodName
(
namespace
)
if
err
!=
nil
{
return
nil
,
err
}
// FIXME use a constain that is accessible on init
const
tillerPort
=
44134
return
kube
.
New
(
nil
)
.
ForwardPort
(
"helm"
,
podName
,
tillerPort
)
return
kube
.
New
(
nil
)
.
ForwardPort
(
namespace
,
podName
,
tillerPort
)
}
func
getTillerPodName
(
namespace
string
)
(
string
,
error
)
{
...
...
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