diff --git a/cmd/helm/list.go b/cmd/helm/list.go index 7ee7565f2..e7293ded6 100644 --- a/cmd/helm/list.go +++ b/cmd/helm/list.go @@ -112,12 +112,13 @@ func newListCmd(cfg *action.Configuration, out io.Writer) *cobra.Command { } type releaseElement struct { - Name string - Namespace string - Revision string - Updated string - Status string - Chart string + Name string + Namespace string + Revision string + Updated string + Status string + Chart string + AppVersion string } type releaseListWriter struct { @@ -129,11 +130,12 @@ func newReleaseListWriter(releases []*release.Release) *releaseListWriter { elements := make([]releaseElement, 0, len(releases)) for _, r := range releases { element := releaseElement{ - Name: r.Name, - Namespace: r.Namespace, - Revision: strconv.Itoa(r.Version), - Status: r.Info.Status.String(), - Chart: fmt.Sprintf("%s-%s", r.Chart.Metadata.Name, r.Chart.Metadata.Version), + Name: r.Name, + Namespace: r.Namespace, + Revision: strconv.Itoa(r.Version), + Status: r.Info.Status.String(), + Chart: fmt.Sprintf("%s-%s", r.Chart.Metadata.Name, r.Chart.Metadata.Version), + AppVersion: r.Chart.Metadata.AppVersion, } t := "-" if tspb := r.Info.LastDeployed; !tspb.IsZero() { @@ -147,9 +149,9 @@ func newReleaseListWriter(releases []*release.Release) *releaseListWriter { func (r *releaseListWriter) WriteTable(out io.Writer) error { table := uitable.New() - table.AddRow("NAME", "NAMESPACE", "REVISION", "UPDATED", "STATUS", "CHART") + table.AddRow("NAME", "NAMESPACE", "REVISION", "UPDATED", "STATUS", "CHART", "APP VERSION") for _, r := range r.releases { - table.AddRow(r.Name, r.Namespace, r.Revision, r.Updated, r.Status, r.Chart) + table.AddRow(r.Name, r.Namespace, r.Revision, r.Updated, r.Status, r.Chart, r.AppVersion) } return action.EncodeTable(out, table) } diff --git a/cmd/helm/list_test.go b/cmd/helm/list_test.go index 8939119d8..886c58176 100644 --- a/cmd/helm/list_test.go +++ b/cmd/helm/list_test.go @@ -34,8 +34,9 @@ func TestListCmd(t *testing.T) { timestamp4 := time.Unix(sampleTimeSeconds+4, 0).UTC() chartInfo := &chart.Chart{ Metadata: &chart.Metadata{ - Name: "chickadee", - Version: "1.0.0", + Name: "chickadee", + Version: "1.0.0", + AppVersion: "0.0.1", }, } diff --git a/cmd/helm/testdata/output/list-all.txt b/cmd/helm/testdata/output/list-all.txt index d8c5efd5d..ef6d44cd5 100644 --- a/cmd/helm/testdata/output/list-all.txt +++ b/cmd/helm/testdata/output/list-all.txt @@ -1,9 +1,9 @@ -NAME NAMESPACE REVISION UPDATED STATUS CHART -drax default 1 2016-01-16 00:00:01 +0000 UTC uninstalling chickadee-1.0.0 -gamora default 1 2016-01-16 00:00:01 +0000 UTC superseded chickadee-1.0.0 -groot default 1 2016-01-16 00:00:01 +0000 UTC uninstalled chickadee-1.0.0 -hummingbird default 1 2016-01-16 00:00:03 +0000 UTC deployed chickadee-1.0.0 -iguana default 2 2016-01-16 00:00:04 +0000 UTC deployed chickadee-1.0.0 -rocket default 1 2016-01-16 00:00:02 +0000 UTC failed chickadee-1.0.0 -starlord default 2 2016-01-16 00:00:01 +0000 UTC deployed chickadee-1.0.0 -thanos default 1 2016-01-16 00:00:01 +0000 UTC pending-install chickadee-1.0.0 +NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION +drax default 1 2016-01-16 00:00:01 +0000 UTC uninstalling chickadee-1.0.0 0.0.1 +gamora default 1 2016-01-16 00:00:01 +0000 UTC superseded chickadee-1.0.0 0.0.1 +groot default 1 2016-01-16 00:00:01 +0000 UTC uninstalled chickadee-1.0.0 0.0.1 +hummingbird default 1 2016-01-16 00:00:03 +0000 UTC deployed chickadee-1.0.0 0.0.1 +iguana default 2 2016-01-16 00:00:04 +0000 UTC deployed chickadee-1.0.0 0.0.1 +rocket default 1 2016-01-16 00:00:02 +0000 UTC failed chickadee-1.0.0 0.0.1 +starlord default 2 2016-01-16 00:00:01 +0000 UTC deployed chickadee-1.0.0 0.0.1 +thanos default 1 2016-01-16 00:00:01 +0000 UTC pending-install chickadee-1.0.0 0.0.1 diff --git a/cmd/helm/testdata/output/list-date-reversed.txt b/cmd/helm/testdata/output/list-date-reversed.txt index 5785d4d3f..8b4e71a38 100644 --- a/cmd/helm/testdata/output/list-date-reversed.txt +++ b/cmd/helm/testdata/output/list-date-reversed.txt @@ -1,5 +1,5 @@ -NAME NAMESPACE REVISION UPDATED STATUS CHART -iguana default 2 2016-01-16 00:00:04 +0000 UTC deployed chickadee-1.0.0 -hummingbird default 1 2016-01-16 00:00:03 +0000 UTC deployed chickadee-1.0.0 -rocket default 1 2016-01-16 00:00:02 +0000 UTC failed chickadee-1.0.0 -starlord default 2 2016-01-16 00:00:01 +0000 UTC deployed chickadee-1.0.0 +NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION +iguana default 2 2016-01-16 00:00:04 +0000 UTC deployed chickadee-1.0.0 0.0.1 +hummingbird default 1 2016-01-16 00:00:03 +0000 UTC deployed chickadee-1.0.0 0.0.1 +rocket default 1 2016-01-16 00:00:02 +0000 UTC failed chickadee-1.0.0 0.0.1 +starlord default 2 2016-01-16 00:00:01 +0000 UTC deployed chickadee-1.0.0 0.0.1 diff --git a/cmd/helm/testdata/output/list-date.txt b/cmd/helm/testdata/output/list-date.txt index 77c8132cd..3d2b27ad8 100644 --- a/cmd/helm/testdata/output/list-date.txt +++ b/cmd/helm/testdata/output/list-date.txt @@ -1,5 +1,5 @@ -NAME NAMESPACE REVISION UPDATED STATUS CHART -starlord default 2 2016-01-16 00:00:01 +0000 UTC deployed chickadee-1.0.0 -rocket default 1 2016-01-16 00:00:02 +0000 UTC failed chickadee-1.0.0 -hummingbird default 1 2016-01-16 00:00:03 +0000 UTC deployed chickadee-1.0.0 -iguana default 2 2016-01-16 00:00:04 +0000 UTC deployed chickadee-1.0.0 +NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION +starlord default 2 2016-01-16 00:00:01 +0000 UTC deployed chickadee-1.0.0 0.0.1 +rocket default 1 2016-01-16 00:00:02 +0000 UTC failed chickadee-1.0.0 0.0.1 +hummingbird default 1 2016-01-16 00:00:03 +0000 UTC deployed chickadee-1.0.0 0.0.1 +iguana default 2 2016-01-16 00:00:04 +0000 UTC deployed chickadee-1.0.0 0.0.1 diff --git a/cmd/helm/testdata/output/list-failed.txt b/cmd/helm/testdata/output/list-failed.txt index f87bbe18f..a8ec3e132 100644 --- a/cmd/helm/testdata/output/list-failed.txt +++ b/cmd/helm/testdata/output/list-failed.txt @@ -1,2 +1,2 @@ -NAME NAMESPACE REVISION UPDATED STATUS CHART -rocket default 1 2016-01-16 00:00:02 +0000 UTC failed chickadee-1.0.0 +NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION +rocket default 1 2016-01-16 00:00:02 +0000 UTC failed chickadee-1.0.0 0.0.1 diff --git a/cmd/helm/testdata/output/list-filter.txt b/cmd/helm/testdata/output/list-filter.txt index 55a4ac8af..0a820922b 100644 --- a/cmd/helm/testdata/output/list-filter.txt +++ b/cmd/helm/testdata/output/list-filter.txt @@ -1,5 +1,5 @@ -NAME NAMESPACE REVISION UPDATED STATUS CHART -hummingbird default 1 2016-01-16 00:00:03 +0000 UTC deployed chickadee-1.0.0 -iguana default 2 2016-01-16 00:00:04 +0000 UTC deployed chickadee-1.0.0 -rocket default 1 2016-01-16 00:00:02 +0000 UTC failed chickadee-1.0.0 -starlord default 2 2016-01-16 00:00:01 +0000 UTC deployed chickadee-1.0.0 +NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION +hummingbird default 1 2016-01-16 00:00:03 +0000 UTC deployed chickadee-1.0.0 0.0.1 +iguana default 2 2016-01-16 00:00:04 +0000 UTC deployed chickadee-1.0.0 0.0.1 +rocket default 1 2016-01-16 00:00:02 +0000 UTC failed chickadee-1.0.0 0.0.1 +starlord default 2 2016-01-16 00:00:01 +0000 UTC deployed chickadee-1.0.0 0.0.1 diff --git a/cmd/helm/testdata/output/list-max.txt b/cmd/helm/testdata/output/list-max.txt index 34f64136c..a909322b4 100644 --- a/cmd/helm/testdata/output/list-max.txt +++ b/cmd/helm/testdata/output/list-max.txt @@ -1,2 +1,2 @@ -NAME NAMESPACE REVISION UPDATED STATUS CHART -hummingbird default 1 2016-01-16 00:00:03 +0000 UTC deployed chickadee-1.0.0 +NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION +hummingbird default 1 2016-01-16 00:00:03 +0000 UTC deployed chickadee-1.0.0 0.0.1 diff --git a/cmd/helm/testdata/output/list-offset.txt b/cmd/helm/testdata/output/list-offset.txt index e97f020ab..36e963ca5 100644 --- a/cmd/helm/testdata/output/list-offset.txt +++ b/cmd/helm/testdata/output/list-offset.txt @@ -1,4 +1,4 @@ -NAME NAMESPACE REVISION UPDATED STATUS CHART -iguana default 2 2016-01-16 00:00:04 +0000 UTC deployed chickadee-1.0.0 -rocket default 1 2016-01-16 00:00:02 +0000 UTC failed chickadee-1.0.0 -starlord default 2 2016-01-16 00:00:01 +0000 UTC deployed chickadee-1.0.0 +NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION +iguana default 2 2016-01-16 00:00:04 +0000 UTC deployed chickadee-1.0.0 0.0.1 +rocket default 1 2016-01-16 00:00:02 +0000 UTC failed chickadee-1.0.0 0.0.1 +starlord default 2 2016-01-16 00:00:01 +0000 UTC deployed chickadee-1.0.0 0.0.1 diff --git a/cmd/helm/testdata/output/list-pending.txt b/cmd/helm/testdata/output/list-pending.txt index 1cb7f8411..f3d7aa03b 100644 --- a/cmd/helm/testdata/output/list-pending.txt +++ b/cmd/helm/testdata/output/list-pending.txt @@ -1,2 +1,2 @@ -NAME NAMESPACE REVISION UPDATED STATUS CHART -thanos default 1 2016-01-16 00:00:01 +0000 UTC pending-install chickadee-1.0.0 +NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION +thanos default 1 2016-01-16 00:00:01 +0000 UTC pending-install chickadee-1.0.0 0.0.1 diff --git a/cmd/helm/testdata/output/list-reverse.txt b/cmd/helm/testdata/output/list-reverse.txt index 7df0baadb..da178b2c3 100644 --- a/cmd/helm/testdata/output/list-reverse.txt +++ b/cmd/helm/testdata/output/list-reverse.txt @@ -1,5 +1,5 @@ -NAME NAMESPACE REVISION UPDATED STATUS CHART -starlord default 2 2016-01-16 00:00:01 +0000 UTC deployed chickadee-1.0.0 -rocket default 1 2016-01-16 00:00:02 +0000 UTC failed chickadee-1.0.0 -iguana default 2 2016-01-16 00:00:04 +0000 UTC deployed chickadee-1.0.0 -hummingbird default 1 2016-01-16 00:00:03 +0000 UTC deployed chickadee-1.0.0 +NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION +starlord default 2 2016-01-16 00:00:01 +0000 UTC deployed chickadee-1.0.0 0.0.1 +rocket default 1 2016-01-16 00:00:02 +0000 UTC failed chickadee-1.0.0 0.0.1 +iguana default 2 2016-01-16 00:00:04 +0000 UTC deployed chickadee-1.0.0 0.0.1 +hummingbird default 1 2016-01-16 00:00:03 +0000 UTC deployed chickadee-1.0.0 0.0.1 diff --git a/cmd/helm/testdata/output/list-superseded.txt b/cmd/helm/testdata/output/list-superseded.txt index e83a8b797..50b435874 100644 --- a/cmd/helm/testdata/output/list-superseded.txt +++ b/cmd/helm/testdata/output/list-superseded.txt @@ -1,3 +1,3 @@ -NAME NAMESPACE REVISION UPDATED STATUS CHART -gamora default 1 2016-01-16 00:00:01 +0000 UTC superseded chickadee-1.0.0 -starlord default 1 2016-01-16 00:00:01 +0000 UTC superseded chickadee-1.0.0 +NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION +gamora default 1 2016-01-16 00:00:01 +0000 UTC superseded chickadee-1.0.0 0.0.1 +starlord default 1 2016-01-16 00:00:01 +0000 UTC superseded chickadee-1.0.0 0.0.1 diff --git a/cmd/helm/testdata/output/list-uninstalled.txt b/cmd/helm/testdata/output/list-uninstalled.txt index f0a419f8e..430cf32fb 100644 --- a/cmd/helm/testdata/output/list-uninstalled.txt +++ b/cmd/helm/testdata/output/list-uninstalled.txt @@ -1,2 +1,2 @@ -NAME NAMESPACE REVISION UPDATED STATUS CHART -groot default 1 2016-01-16 00:00:01 +0000 UTC uninstalled chickadee-1.0.0 +NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION +groot default 1 2016-01-16 00:00:01 +0000 UTC uninstalled chickadee-1.0.0 0.0.1 diff --git a/cmd/helm/testdata/output/list-uninstalling.txt b/cmd/helm/testdata/output/list-uninstalling.txt index a90771361..922896391 100644 --- a/cmd/helm/testdata/output/list-uninstalling.txt +++ b/cmd/helm/testdata/output/list-uninstalling.txt @@ -1,2 +1,2 @@ -NAME NAMESPACE REVISION UPDATED STATUS CHART -drax default 1 2016-01-16 00:00:01 +0000 UTC uninstalling chickadee-1.0.0 +NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION +drax default 1 2016-01-16 00:00:01 +0000 UTC uninstalling chickadee-1.0.0 0.0.1 diff --git a/cmd/helm/testdata/output/list.txt b/cmd/helm/testdata/output/list.txt index 55a4ac8af..0a820922b 100644 --- a/cmd/helm/testdata/output/list.txt +++ b/cmd/helm/testdata/output/list.txt @@ -1,5 +1,5 @@ -NAME NAMESPACE REVISION UPDATED STATUS CHART -hummingbird default 1 2016-01-16 00:00:03 +0000 UTC deployed chickadee-1.0.0 -iguana default 2 2016-01-16 00:00:04 +0000 UTC deployed chickadee-1.0.0 -rocket default 1 2016-01-16 00:00:02 +0000 UTC failed chickadee-1.0.0 -starlord default 2 2016-01-16 00:00:01 +0000 UTC deployed chickadee-1.0.0 +NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION +hummingbird default 1 2016-01-16 00:00:03 +0000 UTC deployed chickadee-1.0.0 0.0.1 +iguana default 2 2016-01-16 00:00:04 +0000 UTC deployed chickadee-1.0.0 0.0.1 +rocket default 1 2016-01-16 00:00:02 +0000 UTC failed chickadee-1.0.0 0.0.1 +starlord default 2 2016-01-16 00:00:01 +0000 UTC deployed chickadee-1.0.0 0.0.1