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
d32c20fd
Commit
d32c20fd
authored
Jun 28, 2016
by
Adam Reese
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ref(cmd): move flags out of init()
parent
eee6e143
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
13 deletions
+18
-13
helm.go
cmd/helm/helm.go
+18
-13
No files found.
cmd/helm/helm.go
View file @
d32c20fd
...
...
@@ -63,30 +63,35 @@ Environment:
$HELM_HOST Set an alternative Tiller host. The format is host:port (default ":44134").
`
// RootCommand is the top-level command for Helm.
var
RootCommand
=
&
cobra
.
Command
{
Use
:
"helm"
,
Short
:
"The Helm package manager for Kubernetes."
,
Long
:
globalUsage
,
PersistentPostRun
:
teardown
,
SilenceUsage
:
true
,
}
func
init
()
{
func
newRootCmd
()
*
cobra
.
Command
{
cmd
:
=
&
cobra
.
Command
{
Use
:
"helm"
,
Short
:
"The Helm package manager for Kubernetes."
,
Long
:
globalUsage
,
SilenceUsage
:
true
,
PersistentPostRun
:
func
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
teardown
()
},
}
home
:=
os
.
Getenv
(
homeEnvVar
)
if
home
==
""
{
home
=
"$HOME/.helm"
}
thost
:=
os
.
Getenv
(
hostEnvVar
)
p
:=
RootComman
d
.
PersistentFlags
()
p
:=
cm
d
.
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"
,
""
,
""
,
"kubernetes namespace"
)
p
.
BoolVarP
(
&
flagDebug
,
"debug"
,
""
,
false
,
"enable verbose output"
)
return
cmd
}
// RootCommand is the top-level command for Helm.
var
RootCommand
=
newRootCmd
()
func
main
()
{
if
err
:=
RootCommand
.
Execute
();
err
!=
nil
{
cmd
:=
RootCommand
if
err
:=
cmd
.
Execute
();
err
!=
nil
{
os
.
Exit
(
1
)
}
}
...
...
@@ -112,7 +117,7 @@ func setupConnection(c *cobra.Command, args []string) error {
return
nil
}
func
teardown
(
c
*
cobra
.
Command
,
args
[]
string
)
{
func
teardown
()
{
if
tunnel
!=
nil
{
tunnel
.
Close
()
}
...
...
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