Skip to content

imagetools: honor non-whole --format templates on inspect - #4006

Open
locker95 wants to merge 1 commit into
docker:masterfrom
locker95:fix/imagetools-inspect-format
Open

imagetools: honor non-whole --format templates on inspect#4006
locker95 wants to merge 1 commit into
docker:masterfrom
locker95:fix/imagetools-inspect-format

Conversation

@locker95

Copy link
Copy Markdown

docker buildx imagetools inspect --format '{{.Manifest.Digest}}' was ignoring the template and printing the default Name/MediaType/Digest table unless you wrapped the value in json (or printf).

This keeps the pretty multi-line layout only for an exact {{.Manifest}} format, runs every other template through text/template, and adds a trailing newline so the shell prompt doesn't stick to the output.

Fixes #1175

Use the original format string for the "{{.Manifest}}" special case
instead of the parsed tree string, execute every other template as-is,
and append a trailing newline so interactive use matches docker inspect.

Fixes docker#1175

Signed-off-by: Dean Chen <862469039@qq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

imagetools inspect --format ignores formatting unless json is used

1 participant