Uh oh!
There was an error while loading. Please reload this page.
Allow --format=json as an alias of --format={{json .}} - #3355
Closed
AkihiroSuda wants to merge 1 commit into
Closed
Conversation
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
codecov-commenter
commented
Nov 1, 2021
Codecov Report
@@ Coverage Diff @@## master #3355 +/- ##
=======================================
Coverage 58.01% 58.01% =======================================
Files 302 302 Lines 21762 21764 +2 =======================================
+ Hits 12625 12627 +2
Misses 8215 8215 Partials 922 922 |
thaJeztah
commented
Nov 1, 2021
Member
Looks like this is the same / similar to #2936 (but there were some pending review comments on that one) /cc @silvin-lubecki |
AkihiroSuda
commented
Nov 1, 2021
CollaboratorAuthor
Ah, didn’t notice… 😅 |
thaJeztah
commented
Nov 1, 2021
Member
Perhaps someone needs to carry that one if @silvin-lubecki doesn't have time though 😅 |
silvin-lubecki
commented
Nov 2, 2021
Contributor
Yes please, I don't think I will be able to allocate time on it 🙏 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
- What I did
Allow
--format=jsonas an alias of--format={{json .}}for convenience.- How I did it
Updated
templates.NewParse- How to verify it
Before:
After:
$ docker image inspect alpine --format=json {"Id":"sha256:14119a10abf4669e8cdbdff324a9f9605d99697215a0d21c360fe8dfa8471bab","RepoTags":["alpine:latest"],"RepoDigests":["alpine@sha256:e1c082e3d3c45cccac829840a25941e679c25d438cc8412c2fa221cf1a824e6a"],"Parent":"","Comment":"","Created":"2021-08-27T17:19:45.758611523Z","Container":"330289c649db86f5fb1ae5bfef18501012b550adb0638b9193d4a3a4b65a2f9b","ContainerConfig":{"Hostname":"330289c649db","Domainname":"","User":"","AttachStdin":false,"AttachStdout":false,"AttachStderr":false,"Tty":false,"OpenStdin":false,"StdinOnce":false,"Env":["PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"],"Cmd":["/bin/sh","-c","#(nop) ","CMD [\"/bin/sh\"]"],"Image":"sha256:d3e0b6258ec2f725c19668f11ae5323c3b0245e197ec478424ec6a87935690eb","Volumes":null,"WorkingDir":"","Entrypoint":null,"OnBuild":null,"Labels":{}},"DockerVersion":"20.10.7","Author":"","Config":{"Hostname":"","Domainname":"","User":"","AttachStdin":false,"AttachStdout":false,"AttachStderr":false,"Tty":false,"OpenStdin":false,"StdinOnce":false,"Env":["PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"],"Cmd":["/bin/sh"],"Image":"sha256:d3e0b6258ec2f725c19668f11ae5323c3b0245e197ec478424ec6a87935690eb","Volumes":null,"WorkingDir":"","Entrypoint":null,"OnBuild":null,"Labels":null},"Architecture":"amd64","Os":"linux","Size":5595292,"VirtualSize":5595292,"GraphDriver":{"Data":{"MergedDir":"/var/lib/docker/overlay2/f2ce81000bfa11a765bf1774978ec5f257aa66c250024fd50e9f5e2ee33043a0/merged","UpperDir":"/var/lib/docker/overlay2/f2ce81000bfa11a765bf1774978ec5f257aa66c250024fd50e9f5e2ee33043a0/diff","WorkDir":"/var/lib/docker/overlay2/f2ce81000bfa11a765bf1774978ec5f257aa66c250024fd50e9f5e2ee33043a0/work"},"Name":"overlay2"},"RootFS":{"Type":"layers","Layers":["sha256:e2eb06d8af8218cfec8210147357a68b7e13f7c485b991c288c2d01dc228bb68"]},"Metadata":{"LastTagTime":"0001-01-01T00:00:00Z"}}- Description for the changelog
Allow
--format=jsonas an alias of--format={{json .}}- A picture of a cute animal (not mandatory but encouraged)
🐧
Podman seems already implemented the same syntax
https://github.com/containers/common/blob/850904b0be9c4960a83acf077e34acc7857312bf/pkg/report/validate.go#L5