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
d3de044f
Commit
d3de044f
authored
Apr 27, 2016
by
Michelle Noorali
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #69 from michelleN/helm-repo-list
feat(helm): add helm repo list command
parents
0ebeecbd
b6411be7
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
2 deletions
+37
-2
repo.go
cmd/helm/repo.go
+27
-0
glide.lock
glide.lock
+9
-2
glide.yaml
glide.yaml
+1
-0
No files found.
cmd/helm/repo.go
View file @
d3de044f
...
...
@@ -5,12 +5,14 @@ import (
"os"
"github.com/deis/tiller/pkg/repo"
"github.com/gosuri/uitable"
"github.com/spf13/cobra"
"gopkg.in/yaml.v2"
)
func
init
()
{
repoCmd
.
AddCommand
(
repoAddCmd
)
repoCmd
.
AddCommand
(
repoListCmd
)
RootCommand
.
AddCommand
(
repoCmd
)
}
...
...
@@ -25,6 +27,12 @@ var repoAddCmd = &cobra.Command{
RunE
:
runRepoAdd
,
}
var
repoListCmd
=
&
cobra
.
Command
{
Use
:
"list [flags]"
,
Short
:
"list chart repositories"
,
RunE
:
runRepoList
,
}
func
runRepoAdd
(
cmd
*
cobra
.
Command
,
args
[]
string
)
error
{
if
len
(
args
)
!=
2
{
return
fmt
.
Errorf
(
"This command needs two argument, a name for the chart repository and the url of the chart repository"
)
...
...
@@ -38,6 +46,25 @@ func runRepoAdd(cmd *cobra.Command, args []string) error {
return
nil
}
func
runRepoList
(
cmd
*
cobra
.
Command
,
args
[]
string
)
error
{
f
,
err
:=
repo
.
LoadRepositoriesFile
(
repositoriesFile
())
if
err
!=
nil
{
return
err
}
if
len
(
f
.
Repositories
)
==
0
{
fmt
.
Println
(
"No repositories to show"
)
return
nil
}
table
:=
uitable
.
New
()
table
.
MaxColWidth
=
50
table
.
AddRow
(
"NAME"
,
"URL"
)
for
k
,
v
:=
range
f
.
Repositories
{
table
.
AddRow
(
k
,
v
)
}
fmt
.
Println
(
table
)
return
nil
}
func
insertRepoLine
(
name
,
url
string
)
error
{
err
:=
checkUniqueName
(
name
)
if
err
!=
nil
{
...
...
glide.lock
View file @
d3de044f
hash:
78e69db1e2c08b4c326c61c47d602ccb5d0d4a782e5047a460e984d0c22f43a3
updated: 2016-04-27T1
3:31:53.384640094-07
:00
hash:
998d87445fec0bd715fa5ccbcc227cb4997e56ceff58dc8eb53ea2e0cc84abfd
updated: 2016-04-27T1
6:11:47.531200165-06
:00
imports:
- name: bitbucket.org/ww/goautoneg
version: 75cd24fc2f2c
...
...
@@ -121,6 +121,11 @@ imports:
- version
- name: github.com/google/gofuzz
version: bbcb9da2d746f8bdbd6a936686a0a6067ada0ec5
- name: github.com/gosuri/uitable
version: 36ee7e946282a3fb1cfecd476ddc9b35d8847e42
subpackages:
- util/strutil
- util/wordwrap
- name: github.com/imdario/mergo
version: 6633656539c1639d9d78127b7d47c622b5d7b6dc
- name: github.com/inconshreveable/mousetrap
...
...
@@ -131,6 +136,8 @@ imports:
version: 808ed7761c233af2de3f9729a041d68c62527f3a
- name: github.com/Masterminds/sprig
version: e6494bc7e81206ba6db404d2fd96500ffc453407
- name: github.com/mattn/go-runewidth
version: d6bea18f789704b5f83375793155289da36a3c7f
- name: github.com/matttproud/golang_protobuf_extensions
version: fc2b8d3a73c4867e51861bbdd5ae3c1f0869dd6a
subpackages:
...
...
glide.yaml
View file @
d3de044f
...
...
@@ -29,3 +29,4 @@ import:
-
pkg/client/unversioned/clientcmd
-
pkg/kubectl/cmd/util
-
pkg/kubectl/resource
-
package
:
github.com/gosuri/uitable
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