feat: Add output format: podman artifact ls --format=json - #29484
feat: Add output format: podman artifact ls --format=json#29484ellieayla wants to merge 1 commit into
Conversation
05c40fc to
8e0335e
Compare
| }) | ||
| } | ||
|
|
||
| switch { |
There was a problem hiding this comment.
I guess a conditional if here and no conditional around the second part would kind of be the same ?
There was a problem hiding this comment.
I agree. I matched the pattern in images/list.go as closely as I could (which also has a quiet option that only dumps the IDs, but maybe someone will want to add something like that here too).
|
My advice would be to squash your commits and sign the one commit (after squashing, |
|
Concur on the squashing commits. Code LGTM |
|
I haven't been able to locate where in all those CI steps the tests actually ran, to verify my added test was OK. Please advise. |
The 'podman artifact ls' command supports a --format flag accepting a go template string. Some commands (eg 'podman image ls') accept a --format=json parameter, and export pure json object to stdout. This change adds a --format=json output mode to artifact lists too. Includes simple documentation mention of --format=json option alongside go template description. Signed-off-by: ellieayla <1447600+me@users.noreply.github.com>
d749d9c to
6d5ab2b
Compare
|
[NON-BLOCKING] Packit jobs failed. @podman-container-tools/packit-jobs please check. Everyone else, feel free to ignore. |
|
I don't understand the test farm failure. @baude ? |
|
Testing-farm is nonblocking, purely advisory |
Honny1
left a comment
There was a problem hiding this comment.
LGTM once CI is green.
Linter is complaining:
+ /home/ubuntu/golangci-lint-2.12.2-linux-amd64/golangci-lint run --build-tags=apparmor,seccomp,selinux
Error: cmd/podman/artifact/list.go:144:1: File is not properly formatted (gofumpt)
^
Error: cmd/podman/artifact/list.go:145:1: unnecessary trailing newline (whitespace)
}
^
The 'podman artifact ls' command supports a --format flag accepting a go template string. Some commands (eg 'podman image ls') accept a --format=json parameter, and export pure json object to stdout.
This change adds a
--format=jsonoutput mode to artifact lists too.Checklist
Ensure you have completed the following checklist for your pull request to be reviewed:
commits. (
git commit -s). (If needed, usegit commit -s --amend). The author email must matchthe sign-off email address. See CONTRIBUTING.md
for more information.
Fixes: #00000in commit message (if applicable)make validatepr(format/lint checks)Noneif no user-facing changes)Does this PR introduce a user-facing change?
Yes, adds a
--format=jsonflag.podman artifact ls --format=json