From 1df4596bb58f2521479131ba9625b9450de6d23c Mon Sep 17 00:00:00 2001 From: cleverhu Date: Mon, 12 Sep 2022 03:50:19 +0800 Subject: [PATCH] add create time for helm search repo Signed-off-by: cleverhu --- cmd/helm/search_repo.go | 5 +++-- cmd/helm/testdata/output/search-constraint-single.txt | 4 ++-- cmd/helm/testdata/output/search-constraint.txt | 4 ++-- cmd/helm/testdata/output/search-multiple-devel-release.txt | 4 ++-- cmd/helm/testdata/output/search-multiple-stable-release.txt | 4 ++-- .../output/search-multiple-versions-constraints.txt | 6 +++--- cmd/helm/testdata/output/search-multiple-versions.txt | 6 +++--- cmd/helm/testdata/output/search-regex.txt | 4 ++-- cmd/helm/testdata/output/search-versions-constraint.txt | 4 ++-- 9 files changed, 21 insertions(+), 20 deletions(-) diff --git a/cmd/helm/search_repo.go b/cmd/helm/search_repo.go index f794f6bca..d4922ccba 100644 --- a/cmd/helm/search_repo.go +++ b/cmd/helm/search_repo.go @@ -25,6 +25,7 @@ import ( "os" "path/filepath" "strings" + "time" "github.com/Masterminds/semver/v3" "github.com/gosuri/uitable" @@ -219,9 +220,9 @@ func (r *repoSearchWriter) WriteTable(out io.Writer) error { } table := uitable.New() table.MaxColWidth = r.columnWidth - table.AddRow("NAME", "CHART VERSION", "APP VERSION", "DESCRIPTION") + table.AddRow("NAME", "CHART VERSION", "APP VERSION", "DESCRIPTION", "CREATED") for _, r := range r.results { - table.AddRow(r.Name, r.Chart.Version, r.Chart.AppVersion, r.Chart.Description) + table.AddRow(r.Name, r.Chart.Version, r.Chart.AppVersion, r.Chart.Description, r.Chart.Created.Format(time.RFC3339)) } return output.EncodeTable(out, table) } diff --git a/cmd/helm/testdata/output/search-constraint-single.txt b/cmd/helm/testdata/output/search-constraint-single.txt index a1f75099f..17e310872 100644 --- a/cmd/helm/testdata/output/search-constraint-single.txt +++ b/cmd/helm/testdata/output/search-constraint-single.txt @@ -1,2 +1,2 @@ -NAME CHART VERSION APP VERSION DESCRIPTION -testing/alpine 0.2.0 2.3.4 Deploy a basic Alpine Linux pod +NAME CHART VERSION APP VERSION DESCRIPTION CREATED +testing/alpine 0.2.0 2.3.4 Deploy a basic Alpine Linux pod 2018-07-09T11:34:37Z diff --git a/cmd/helm/testdata/output/search-constraint.txt b/cmd/helm/testdata/output/search-constraint.txt index 9fb22fe76..b289af9ee 100644 --- a/cmd/helm/testdata/output/search-constraint.txt +++ b/cmd/helm/testdata/output/search-constraint.txt @@ -1,2 +1,2 @@ -NAME CHART VERSION APP VERSION DESCRIPTION -testing/alpine 0.1.0 1.2.3 Deploy a basic Alpine Linux pod +NAME CHART VERSION APP VERSION DESCRIPTION CREATED +testing/alpine 0.1.0 1.2.3 Deploy a basic Alpine Linux pod 2018-06-27T10:00:18Z diff --git a/cmd/helm/testdata/output/search-multiple-devel-release.txt b/cmd/helm/testdata/output/search-multiple-devel-release.txt index 7e29a8f7e..e12bcba57 100644 --- a/cmd/helm/testdata/output/search-multiple-devel-release.txt +++ b/cmd/helm/testdata/output/search-multiple-devel-release.txt @@ -1,2 +1,2 @@ -NAME CHART VERSION APP VERSION DESCRIPTION -testing/alpine 0.3.0-rc.1 3.0.0 Deploy a basic Alpine Linux pod +NAME CHART VERSION APP VERSION DESCRIPTION CREATED +testing/alpine 0.3.0-rc.1 3.0.0 Deploy a basic Alpine Linux pod 2020-11-12T08:44:58Z diff --git a/cmd/helm/testdata/output/search-multiple-stable-release.txt b/cmd/helm/testdata/output/search-multiple-stable-release.txt index a1f75099f..17e310872 100644 --- a/cmd/helm/testdata/output/search-multiple-stable-release.txt +++ b/cmd/helm/testdata/output/search-multiple-stable-release.txt @@ -1,2 +1,2 @@ -NAME CHART VERSION APP VERSION DESCRIPTION -testing/alpine 0.2.0 2.3.4 Deploy a basic Alpine Linux pod +NAME CHART VERSION APP VERSION DESCRIPTION CREATED +testing/alpine 0.2.0 2.3.4 Deploy a basic Alpine Linux pod 2018-07-09T11:34:37Z diff --git a/cmd/helm/testdata/output/search-multiple-versions-constraints.txt b/cmd/helm/testdata/output/search-multiple-versions-constraints.txt index a6a388858..51362c358 100644 --- a/cmd/helm/testdata/output/search-multiple-versions-constraints.txt +++ b/cmd/helm/testdata/output/search-multiple-versions-constraints.txt @@ -1,3 +1,3 @@ -NAME CHART VERSION APP VERSION DESCRIPTION -testing/alpine 0.2.0 2.3.4 Deploy a basic Alpine Linux pod -testing/alpine 0.1.0 1.2.3 Deploy a basic Alpine Linux pod +NAME CHART VERSION APP VERSION DESCRIPTION CREATED +testing/alpine 0.2.0 2.3.4 Deploy a basic Alpine Linux pod 2018-07-09T11:34:37Z +testing/alpine 0.1.0 1.2.3 Deploy a basic Alpine Linux pod 2018-06-27T10:00:18Z diff --git a/cmd/helm/testdata/output/search-multiple-versions.txt b/cmd/helm/testdata/output/search-multiple-versions.txt index a6a388858..51362c358 100644 --- a/cmd/helm/testdata/output/search-multiple-versions.txt +++ b/cmd/helm/testdata/output/search-multiple-versions.txt @@ -1,3 +1,3 @@ -NAME CHART VERSION APP VERSION DESCRIPTION -testing/alpine 0.2.0 2.3.4 Deploy a basic Alpine Linux pod -testing/alpine 0.1.0 1.2.3 Deploy a basic Alpine Linux pod +NAME CHART VERSION APP VERSION DESCRIPTION CREATED +testing/alpine 0.2.0 2.3.4 Deploy a basic Alpine Linux pod 2018-07-09T11:34:37Z +testing/alpine 0.1.0 1.2.3 Deploy a basic Alpine Linux pod 2018-06-27T10:00:18Z diff --git a/cmd/helm/testdata/output/search-regex.txt b/cmd/helm/testdata/output/search-regex.txt index a1f75099f..17e310872 100644 --- a/cmd/helm/testdata/output/search-regex.txt +++ b/cmd/helm/testdata/output/search-regex.txt @@ -1,2 +1,2 @@ -NAME CHART VERSION APP VERSION DESCRIPTION -testing/alpine 0.2.0 2.3.4 Deploy a basic Alpine Linux pod +NAME CHART VERSION APP VERSION DESCRIPTION CREATED +testing/alpine 0.2.0 2.3.4 Deploy a basic Alpine Linux pod 2018-07-09T11:34:37Z diff --git a/cmd/helm/testdata/output/search-versions-constraint.txt b/cmd/helm/testdata/output/search-versions-constraint.txt index 9fb22fe76..b289af9ee 100644 --- a/cmd/helm/testdata/output/search-versions-constraint.txt +++ b/cmd/helm/testdata/output/search-versions-constraint.txt @@ -1,2 +1,2 @@ -NAME CHART VERSION APP VERSION DESCRIPTION -testing/alpine 0.1.0 1.2.3 Deploy a basic Alpine Linux pod +NAME CHART VERSION APP VERSION DESCRIPTION CREATED +testing/alpine 0.1.0 1.2.3 Deploy a basic Alpine Linux pod 2018-06-27T10:00:18Z