-
Notifications
You must be signed in to change notification settings - Fork 807
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use common library reporter #1822
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. Is this just for the extra functions?
- If so, why not just use
DefaultFuncs
directly? The other manipulations of the format string are not obviously desirable or harmless. (They might well be an improvement, but this PR doesn’t make an argument either way.) - The new functions usable in the format string need to be documented somehow, otherwise will not be something users can rely on. That might well be a link to some other documentation that already exists, just not nothing.
@mtrmac The goal here was to have output filters from The docs don't really outline these custom functions either way: The godoc has some documentation on it: https://pkg.go.dev/github.com/containers/[email protected]/pkg/report I'm happy to add additional documentation somewhere if you'd like. |
It’s more that it was never discussed (the history is #1070 ); so now we essentially get do define what needs to happen. Speaking for Skopeo, “Go templates as they existing the Go standard library” is a simple story to tell (although that’s not quite what Skopeo does, sadly). Any other features do need to be documented somehow. Linking to |
Works for me. I opened containers/common#1260 to get some deep links available on pkg.go.dev. Should I add the local details of this to https://github.com/containers/skopeo/blob/main/docs/skopeo-inspect.1.md ? |
Thanks! At the very least a link to the resulting page on |
@mtrmac Updated PR with docs. The anchor in the link won't work until containers/common#1260 is merged, but the format of it will be similar to https://pkg.go.dev/encoding/gob#hdr-Encoding_Details |
The common PR has been merged, and you can see the link works at https://pkg.go.dev/github.com/containers/common@main/pkg/report#hdr-Template_Functions Once the common library cuts a new version, then it will be available at https://pkg.go.dev/github.com/containers/common/pkg/report#hdr-Template_Functions |
@cblecker looks like you need a rebase here. |
@TomSweeneyRedHat Thanks for the ping. Rebased. |
LGTM |
A friendly reminder that this PR had no activity for 30 days. |
@mtrmac @TomSweeneyRedHat I've resolved the merge conflict again. Is it possible to get this merged? |
LGTM |
ee5e2a6
to
a99c508
Compare
880a104
to
385ff0e
Compare
LGTM. One of the things that @edsantiago has done in Podman is to a table to help users with --format options. From
|
@cblecker sorry, had another suggestion for consideration. Regardless if you take it or not, LGTM. |
LGTM |
Well, that’s not actually what this PR does; Podman uses Now… as it happens, the net effect of this PR is actually that Alternatively, Skopeo could be moved to use the
The version in this PR right now, using a function from |
#1921, for the record. |
… actually, looking at the history, as of the original #1070 Skopeo’s So updating to catch up, and to use |
https://github.com/containers/podman/blob/v2.2.0/cmd/podman/inspect/inspect.go , so that I don’t need to look that up again |
Thank you for the detailed review, @mtrmac. That totally makes sense. It looks like containers/podman#15673 was where they made changes to how reports were done in podman, and I pulled those changes over. Compiled locally, and it seems to work as intended. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
One last change, please.
Signed-off-by: Christoph Blecker <[email protected]>
Signed-off-by: Christoph Blecker <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks!
This uses the common library reporter template generation, so that we can use the DefaultFuncs in format output: https://github.com/containers/common/blob/main/pkg/report/template.go#L37