mirror of
https://github.com/helm/helm.git
synced 2026-04-28 17:49:47 -04:00
Merge pull request #3059 from mattfarina/feat/appversion-search
feat(search): Expose AppVersion in search results
This commit is contained in:
commit
ca4d543151
3 changed files with 8 additions and 6 deletions
|
|
@ -125,9 +125,9 @@ func (s *searchCmd) formatSearchResults(res []*search.Result) string {
|
|||
}
|
||||
table := uitable.New()
|
||||
table.MaxColWidth = 50
|
||||
table.AddRow("NAME", "VERSION", "DESCRIPTION")
|
||||
table.AddRow("NAME", "CHART VERSION", "APP VERSION", "DESCRIPTION")
|
||||
for _, r := range res {
|
||||
table.AddRow(r.Name, r.Chart.Version, r.Chart.Description)
|
||||
table.AddRow(r.Name, r.Chart.Version, r.Chart.AppVersion, r.Chart.Description)
|
||||
}
|
||||
return table.String()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,18 +34,18 @@ func TestSearchCmd(t *testing.T) {
|
|||
{
|
||||
name: "search for 'maria', expect one match",
|
||||
args: []string{"maria"},
|
||||
expect: "NAME \tVERSION\tDESCRIPTION \ntesting/mariadb\t0.3.0 \tChart for MariaDB",
|
||||
expect: "NAME \tCHART VERSION\tAPP VERSION\tDESCRIPTION \ntesting/mariadb\t0.3.0 \t \tChart for MariaDB",
|
||||
},
|
||||
{
|
||||
name: "search for 'alpine', expect two matches",
|
||||
args: []string{"alpine"},
|
||||
expect: "NAME \tVERSION\tDESCRIPTION \ntesting/alpine\t0.2.0 \tDeploy a basic Alpine Linux pod",
|
||||
expect: "NAME \tCHART VERSION\tAPP VERSION\tDESCRIPTION \ntesting/alpine\t0.2.0 \t2.3.4 \tDeploy a basic Alpine Linux pod",
|
||||
},
|
||||
{
|
||||
name: "search for 'alpine' with versions, expect three matches",
|
||||
args: []string{"alpine"},
|
||||
flags: []string{"--versions"},
|
||||
expect: "NAME \tVERSION\tDESCRIPTION \ntesting/alpine\t0.2.0 \tDeploy a basic Alpine Linux pod\ntesting/alpine\t0.1.0 \tDeploy a basic Alpine Linux pod",
|
||||
expect: "NAME \tCHART VERSION\tAPP VERSION\tDESCRIPTION \ntesting/alpine\t0.2.0 \t2.3.4 \tDeploy a basic Alpine Linux pod\ntesting/alpine\t0.1.0 \t1.2.3 \tDeploy a basic Alpine Linux pod",
|
||||
},
|
||||
{
|
||||
name: "search for 'syzygy', expect no matches",
|
||||
|
|
@ -56,7 +56,7 @@ func TestSearchCmd(t *testing.T) {
|
|||
name: "search for 'alp[a-z]+', expect two matches",
|
||||
args: []string{"alp[a-z]+"},
|
||||
flags: []string{"--regexp"},
|
||||
expect: "NAME \tVERSION\tDESCRIPTION \ntesting/alpine\t0.2.0 \tDeploy a basic Alpine Linux pod",
|
||||
expect: "NAME \tCHART VERSION\tAPP VERSION\tDESCRIPTION \ntesting/alpine\t0.2.0 \t2.3.4 \tDeploy a basic Alpine Linux pod",
|
||||
regexp: true,
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ entries:
|
|||
sources:
|
||||
- https://github.com/kubernetes/helm
|
||||
version: 0.1.0
|
||||
appVersion: 1.2.3
|
||||
description: Deploy a basic Alpine Linux pod
|
||||
keywords: []
|
||||
maintainers: []
|
||||
|
|
@ -20,6 +21,7 @@ entries:
|
|||
sources:
|
||||
- https://github.com/kubernetes/helm
|
||||
version: 0.2.0
|
||||
appVersion: 2.3.4
|
||||
description: Deploy a basic Alpine Linux pod
|
||||
keywords: []
|
||||
maintainers: []
|
||||
|
|
|
|||
Loading…
Reference in a new issue