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
af379faf
Commit
af379faf
authored
Feb 23, 2017
by
Matt Butcher
Committed by
GitHub
Feb 23, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2008 from technosophos/feat/1624-disable-plugins
feat(helm): allow disabling plugins
parents
2806c0d5
81dbdeb1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
0 deletions
+29
-0
helm.go
cmd/helm/helm.go
+1
-0
plugins.go
cmd/helm/plugins.go
+6
-0
plugins_test.go
cmd/helm/plugins_test.go
+22
-0
No files found.
cmd/helm/helm.go
View file @
af379faf
...
...
@@ -76,6 +76,7 @@ Common actions from this point include:
Environment:
$HELM_HOME set an alternative location for Helm files. By default, these are stored in ~/.helm
$HELM_HOST set an alternative Tiller host. The format is host:port
$HELM_NO_PLUGINS disable plugins. Set HELM_NO_PLUGINS=1 to disable plugins.
$TILLER_NAMESPACE set an alternative Tiller namespace (default "kube-namespace")
$KUBECONFIG set an alternative Kubernetes configuration file (default "~/.kube/config")
`
...
...
cmd/helm/plugins.go
View file @
af379faf
...
...
@@ -37,6 +37,12 @@ const pluginEnvVar = "HELM_PLUGIN"
// to inspect its environment and then add commands to the base command
// as it finds them.
func
loadPlugins
(
baseCmd
*
cobra
.
Command
,
home
helmpath
.
Home
,
out
io
.
Writer
)
{
// If HELM_NO_PLUGINS is set to 1, do not load plugins.
if
os
.
Getenv
(
"HELM_NO_PLUGINS"
)
==
"1"
{
return
}
plugdirs
:=
os
.
Getenv
(
pluginEnvVar
)
if
plugdirs
==
""
{
plugdirs
=
home
.
Plugins
()
...
...
cmd/helm/plugins_test.go
View file @
af379faf
...
...
@@ -134,6 +134,28 @@ func TestLoadPlugins(t *testing.T) {
}
}
func
TestLoadPlugins_HelmNoPlugins
(
t
*
testing
.
T
)
{
os
.
Setenv
(
"HELM_NO_PLUGINS"
,
"1"
)
defer
os
.
Setenv
(
"HELM_NO_PLUGINS"
,
"0"
)
// Set helm home to point to testdata
old
:=
helmHome
helmHome
=
"testdata/helmhome"
defer
func
()
{
helmHome
=
old
}()
hh
:=
helmpath
.
Home
(
homePath
())
out
:=
bytes
.
NewBuffer
(
nil
)
cmd
:=
&
cobra
.
Command
{}
loadPlugins
(
cmd
,
hh
,
out
)
plugins
:=
cmd
.
Commands
()
if
len
(
plugins
)
!=
0
{
t
.
Fatalf
(
"Expected 0 plugins, got %d"
,
len
(
plugins
))
}
}
func
TestSetupEnv
(
t
*
testing
.
T
)
{
name
:=
"pequod"
hh
:=
helmpath
.
Home
(
"testdata/helmhome"
)
...
...
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