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
539041e4
Unverified
Commit
539041e4
authored
Apr 18, 2018
by
Michelle Noorali
Committed by
GitHub
Apr 18, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3903 from derekbassett/helm-ls-modification-rebase
Add App Version to the helm ls command.
parents
513dc6bd
0209ac32
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
3 deletions
+29
-3
list.go
cmd/helm/list.go
+3
-2
list_test.go
cmd/helm/list_test.go
+26
-1
No files found.
cmd/helm/list.go
View file @
539041e4
...
...
@@ -237,7 +237,7 @@ func formatList(rels []*release.Release, colWidth uint) string {
table
:=
uitable
.
New
()
table
.
MaxColWidth
=
colWidth
table
.
AddRow
(
"NAME"
,
"REVISION"
,
"UPDATED"
,
"STATUS"
,
"CHART"
,
"NAMESPACE"
)
table
.
AddRow
(
"NAME"
,
"REVISION"
,
"UPDATED"
,
"STATUS"
,
"CHART"
,
"
APP VERSION"
,
"
NAMESPACE"
)
for
_
,
r
:=
range
rels
{
md
:=
r
.
GetChart
()
.
GetMetadata
()
c
:=
fmt
.
Sprintf
(
"%s-%s"
,
md
.
GetName
(),
md
.
GetVersion
())
...
...
@@ -247,8 +247,9 @@ func formatList(rels []*release.Release, colWidth uint) string {
}
s
:=
r
.
GetInfo
()
.
GetStatus
()
.
GetCode
()
.
String
()
v
:=
r
.
GetVersion
()
a
:=
md
.
GetAppVersion
()
n
:=
r
.
GetNamespace
()
table
.
AddRow
(
r
.
GetName
(),
v
,
t
,
s
,
c
,
n
)
table
.
AddRow
(
r
.
GetName
(),
v
,
t
,
s
,
c
,
a
,
n
)
}
return
table
.
String
()
}
cmd/helm/list_test.go
View file @
539041e4
...
...
@@ -22,11 +22,29 @@ import (
"github.com/spf13/cobra"
"io/ioutil"
"k8s.io/helm/pkg/chartutil"
"k8s.io/helm/pkg/helm"
"k8s.io/helm/pkg/proto/hapi/chart"
"k8s.io/helm/pkg/proto/hapi/release"
"os"
)
func
TestListCmd
(
t
*
testing
.
T
)
{
tmpChart
,
_
:=
ioutil
.
TempDir
(
"testdata"
,
"tmp"
)
defer
os
.
RemoveAll
(
tmpChart
)
cfile
:=
&
chart
.
Metadata
{
Name
:
"foo"
,
Description
:
"A Helm chart for Kubernetes"
,
Version
:
"0.1.0-beta.1"
,
AppVersion
:
"2.X.A"
,
}
chartPath
,
err
:=
chartutil
.
Create
(
cfile
,
tmpChart
)
if
err
!=
nil
{
t
.
Errorf
(
"Error creating chart for list: %v"
,
err
)
}
ch
,
_
:=
chartutil
.
Load
(
chartPath
)
tests
:=
[]
releaseCase
{
{
name
:
"with a release"
,
...
...
@@ -40,7 +58,14 @@ func TestListCmd(t *testing.T) {
rels
:
[]
*
release
.
Release
{
helm
.
ReleaseMock
(
&
helm
.
MockReleaseOptions
{
Name
:
"atlas"
}),
},
expected
:
"NAME
\t
REVISION
\t
UPDATED
\t
STATUS
\t
CHART
\t
NAMESPACE
\n
atlas
\t
1
\t
(.*)
\t
DEPLOYED
\t
foo-0.1.0-beta.1
\t
default
\n
"
,
expected
:
"NAME
\t
REVISION
\t
UPDATED
\t
STATUS
\t
CHART
\t
APP VERSION
\t
NAMESPACE
\n
atlas
\t
1
\t
(.*)
\t
DEPLOYED
\t
foo-0.1.0-beta.1
\t
\t
default
\n
"
,
},
{
name
:
"list with appVersion"
,
rels
:
[]
*
release
.
Release
{
helm
.
ReleaseMock
(
&
helm
.
MockReleaseOptions
{
Name
:
"atlas"
,
Chart
:
ch
}),
},
expected
:
"NAME
\t
REVISION
\t
UPDATED
\t
STATUS
\t
CHART
\t
APP VERSION
\t
NAMESPACE
\n
atlas
\t
1
\t
(.*)
\t
DEPLOYED
\t
foo-0.1.0-beta.1
\t
2.X.A
\t
default
\n
"
,
},
{
name
:
"list, one deployed, one failed"
,
...
...
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