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
967d1e85
Commit
967d1e85
authored
Dec 20, 2016
by
Adam Reese
Committed by
GitHub
Dec 20, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1709 from adamreese/fix/tiller-plugin-ns
fix(helm): add tiller-host to plugin environment
parents
5fc020f0
5961cc44
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
9 deletions
+9
-9
plugins.go
cmd/helm/plugins.go
+3
-2
plugins_test.go
cmd/helm/plugins_test.go
+6
-7
No files found.
cmd/helm/plugins.go
View file @
967d1e85
...
...
@@ -63,7 +63,7 @@ func loadPlugins(baseCmd *cobra.Command, home helmpath.Home, out io.Writer) {
RunE
:
func
(
cmd
*
cobra
.
Command
,
args
[]
string
)
error
{
k
,
u
:=
manuallyProcessArgs
(
args
)
if
err
:=
cmd
.
ParseFlags
(
k
);
err
!=
nil
{
if
err
:=
cmd
.
Par
ent
()
.
Par
seFlags
(
k
);
err
!=
nil
{
return
err
}
...
...
@@ -112,7 +112,7 @@ func loadPlugins(baseCmd *cobra.Command, home helmpath.Home, out io.Writer) {
func
manuallyProcessArgs
(
args
[]
string
)
([]
string
,
[]
string
)
{
known
:=
[]
string
{}
unknown
:=
[]
string
{}
kvargs
:=
[]
string
{
"--host"
,
"--kube-context"
,
"--home"
}
kvargs
:=
[]
string
{
"--host"
,
"--kube-context"
,
"--home"
,
"--tiller-namespace"
}
knownArg
:=
func
(
a
string
)
bool
{
for
_
,
pre
:=
range
kvargs
{
if
strings
.
HasPrefix
(
a
,
pre
+
"="
)
{
...
...
@@ -176,6 +176,7 @@ func setupEnv(shortname, base, plugdirs string, home helmpath.Home) {
"HELM_PATH_STARTER"
:
home
.
Starters
(),
"TILLER_HOST"
:
tillerHost
,
tillerNamespaceEnvVar
:
tillerNamespace
,
}
{
os
.
Setenv
(
key
,
val
)
}
...
...
cmd/helm/plugins_test.go
View file @
967d1e85
...
...
@@ -31,18 +31,16 @@ import (
func
TestManuallyProcessArgs
(
t
*
testing
.
T
)
{
input
:=
[]
string
{
"--debug"
,
"--foo"
,
"bar"
,
"--host"
,
"example.com"
,
"--kube-context"
,
"test1"
,
"--foo"
,
"bar"
,
"--host"
,
"example.com"
,
"--kube-context"
,
"test1"
,
"--home=/tmp"
,
"--tiller-namespace=hello"
,
"command"
,
}
expectKnown
:=
[]
string
{
"--debug"
,
"--host"
,
"example.com"
,
"--kube-context"
,
"test1"
,
"--home=/tmp"
,
"--debug"
,
"--host"
,
"example.com"
,
"--kube-context"
,
"test1"
,
"--home=/tmp"
,
"--tiller-namespace=hello"
,
}
expectUnknown
:=
[]
string
{
...
...
@@ -162,6 +160,7 @@ func TestSetupEnv(t *testing.T) {
{
"HELM_PATH_LOCAL_REPOSITORY"
,
hh
.
LocalRepository
()},
{
"HELM_PATH_STARTER"
,
hh
.
Starters
()},
{
"TILLER_HOST"
,
tillerHost
},
{
"TILLER_NAMESPACE"
,
tillerNamespace
},
}
{
if
got
:=
os
.
Getenv
(
tt
.
name
);
got
!=
tt
.
expect
{
t
.
Errorf
(
"Expected $%s=%q, got %q"
,
tt
.
name
,
tt
.
expect
,
got
)
...
...
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