Skip to content

feat(list): Optional output as JSON and YAML - #3923

Merged
bacongobbler merged 1 commit into
helm:masterfrom
seaneagan:list_cmd_output_format
Jun 11, 2018
Merged

bacongobbler merged 1 commit into
helm:masterfrom
seaneagan:list_cmd_output_format

Conversation

@seaneagan

Copy link
Copy Markdown

The choice of interface --output (json|yaml) is to match that of the
status command, except that -o is not available as it is already used
by --offset.

WIP #1534

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Apr 18, 2018
@seaneagan
seaneagan force-pushed the list_cmd_output_format branch from 80f1c13 to b215e72 Compare April 18, 2018 20:01
The choice of interface `--output (json|yaml)` is to match that of the
status command, except that -o is not available as it is already used
by --offset.

WIP helm#1534
@seaneagan
seaneagan force-pushed the list_cmd_output_format branch from b215e72 to 49c3d50 Compare April 18, 2018 20:36
@seaneagan

Copy link
Copy Markdown
Author

@jascott1 is anyone able to take a look at this one?

Comment thread cmd/helm/list.go
}

switch format {
case "":

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably accept --format=plain as an available option instead, and make that the default. --format="" seems a little odd from a UX perspective on its intended behaviour. What do you think?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually it looks like this is consistent with helm status --output="", so we already have precedent here.

@bacongobbler bacongobbler left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

manually tested, LGTM

@bacongobbler

Copy link
Copy Markdown
Member

needs sign off from another maintainer though since it's a size/L

@bacongobbler bacongobbler added the v3.x Issues and Pull Requests related to the major version v3 label Jun 11, 2018

@jascott1 jascott1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@bacongobbler
bacongobbler merged commit f63baab into helm:master Jun 11, 2018
@jwatte

jwatte commented Oct 18, 2018

Copy link
Copy Markdown

Which version did this merge into?

[12:55:08] jwatte@xps15:~/observe$ helm version
Client: &version.Version{SemVer:"v2.9.1", GitCommit:"20adb27c7c5868466912eebdf6664e7390ebe710", GitTreeState:"clean"}
Server: &version.Version{SemVer:"v2.9.1", GitCommit:"20adb27c7c5868466912eebdf6664e7390ebe710", GitTreeState:"clean"}

[12:55:11] jwatte@xps15:~/observe$ helm list --format=text
Error: unknown flag: --format

@bacongobbler

Copy link
Copy Markdown
Member

v2.10.0.

@eiva

eiva commented Jul 31, 2019 •

Copy link
Copy Markdown

Still nothing...

> helm list --format=json
Error: unknown flag: --format
> helm version
Client: &version.Version{SemVer:"v2.14.1", GitCommit:"5270352a09c7e8b6e8c9593002a73535276507c0", GitTreeState:"clean"}

Same for helm template none of --format or --output works for templating...

@bacongobbler

bacongobbler commented Jul 31, 2019 •

Copy link
Copy Markdown
Member

Use helm list --output json.

><> helm version
Client: &version.Version{SemVer:"v2.14.2", GitCommit:"a8b13cc5ab6a7dbef0a58f5061bcc7c0c61598e7", GitTreeState:"clean"}
Server: &version.Version{SemVer:"v2.14.2", GitCommit:"a8b13cc5ab6a7dbef0a58f5061bcc7c0c61598e7", GitTreeState:"clean"}
><> helm list --output json | python -m json.tool
{
    "Next": "",
    "Releases": [
        {
            "AppVersion": "5.2.2",
            "Chart": "wordpress-7.0.1",
            "Name": "jaundiced-elk",
            "Namespace": "default",
            "Revision": 1,
            "Status": "DEPLOYED",
            "Updated": "Wed Jul 31 11:07:20 2019"
        }
    ]
}

@mattfarina mattfarina added the Needs v3 backport Label PRs for v4/main, which are still applicable to v3 so need a separate backport PR label Sep 16, 2019
@thomastaylor312 thomastaylor312 added the v3 port complete For completed v2->v3 ports label Sep 25, 2019
@iftachsc

iftachsc commented Dec 8, 2019

Copy link
Copy Markdown

i have helm client v2.12.1 how come it doesnt have --format param?

@bacongobbler

Copy link
Copy Markdown
Member

In helm 2, it’s helm list —output json. See above^

@iftachsc

iftachsc commented Dec 8, 2019

Copy link
Copy Markdown

i was looking for this for helm search comand. not ls.
i am getting Error: unknown flag: --output
anyway i solved it with curl call to the api - it returns json

@magmax

magmax commented Jan 24, 2022

Copy link
Copy Markdown

what about template?

$ helm version                                                                                                                                                                                                                                                                        
version.BuildInfo{Version:"v3.5.4", GitCommit:"1b5edb69df3d3a08df77c9902dc17af864ff05d1", GitTreeState:"clean", GoVersion:"go1.15.11"}
$ helm template --output json .
Error: unknown flag: --output
$ helm template --format json .                                                                                                                                                                                                                                                       
Error: unknown flag: --format
$

@gjenkins8 gjenkins8 removed the Needs v3 backport Label PRs for v4/main, which are still applicable to v3 so need a separate backport PR label Dec 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. v3 port complete For completed v2->v3 ports v3.x Issues and Pull Requests related to the major version v3

Projects

None yet

Development

Successfully merging this pull request may close these issues.