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
4d92bd08
Commit
4d92bd08
authored
Jun 29, 2016
by
Adam Reese
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(cmd): lazy load client
parent
5013da3d
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
10 deletions
+10
-10
helm.go
cmd/helm/helm.go
+6
-6
list.go
cmd/helm/list.go
+4
-4
No files found.
cmd/helm/helm.go
View file @
4d92bd08
...
...
@@ -19,6 +19,7 @@ package main
import
(
"errors"
"fmt"
"io"
"os"
"strings"
...
...
@@ -63,7 +64,7 @@ Environment:
$HELM_HOST Set an alternative Tiller host. The format is host:port (default ":44134").
`
func
newRootCmd
()
*
cobra
.
Command
{
func
newRootCmd
(
out
io
.
Writer
)
*
cobra
.
Command
{
cmd
:=
&
cobra
.
Command
{
Use
:
"helm"
,
Short
:
"The Helm package manager for Kubernetes."
,
...
...
@@ -83,18 +84,17 @@ func newRootCmd() *cobra.Command {
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"
)
cmd
.
AddCommand
(
newListCmd
(
nil
,
out
))
return
cmd
}
// RootCommand is the top-level command for Helm.
var
RootCommand
=
newRootCmd
()
var
RootCommand
=
newRootCmd
(
os
.
Stdout
)
func
main
()
{
out
:=
os
.
Stdout
client
:=
helm
.
NewClient
(
helm
.
HelmHost
(
helm
.
Config
.
ServAddr
))
cmd
:=
RootCommand
cmd
.
AddCommand
(
newListCmd
(
client
,
out
))
if
err
:=
cmd
.
Execute
();
err
!=
nil
{
os
.
Exit
(
1
)
}
...
...
cmd/helm/list.go
View file @
4d92bd08
...
...
@@ -65,10 +65,7 @@ type lister struct {
}
func
newListCmd
(
client
helm
.
Interface
,
out
io
.
Writer
)
*
cobra
.
Command
{
list
:=
&
lister
{
client
:
client
,
out
:
out
,
}
list
:=
&
lister
{
out
:
out
}
cmd
:=
&
cobra
.
Command
{
Use
:
"list [flags] [FILTER]"
,
Short
:
"list releases"
,
...
...
@@ -79,6 +76,9 @@ func newListCmd(client helm.Interface, out io.Writer) *cobra.Command {
if
len
(
args
)
>
0
{
list
.
filter
=
strings
.
Join
(
args
,
" "
)
}
if
list
.
client
==
nil
{
list
.
client
=
helm
.
NewClient
(
helm
.
HelmHost
(
helm
.
Config
.
ServAddr
))
}
return
list
.
run
()
},
}
...
...
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