-
Notifications
You must be signed in to change notification settings - Fork 85
Add --version to cmd to show version information #9
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
Conversation
|
yeah, git commit will be useful also to print some debug while validating images maybe - we'll need opencontainers/image-spec#307 also somehow |
| func (v *bundleCmd) Run(cmd *cobra.Command, args []string) { | ||
| if v.version { | ||
| v.stderr.Printf("commit: %s", gitCommit) | ||
| v.stderr.Printf("spec: %s", specs.Version) |
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.
I expect image-tools to support a range of spec versions, not just a single one. For example, once image-spec cuts 2.0, image-tools should still be able to process 1.x images for some reasonable deprecation period. image-spec is setting us up for that possibility by using the v1 package for the Go types that are likely to change. And SemVer means that if we can unpack a 1.3 image, we can also unpack 1.2, 1.1, and 1.0 images. So I think we want this to be printing:
specs: 0.4.0
now. Once opencontainers/image-spec#289 lands and we bump to the new tag, we should be showing:
specs: 0.5.0
Once 1.0 is cut we should show:
specs: 1.0.0
Once 1.1 is cut we should show our position in the 1.x series:
specs: 1.1.0
And then when 2.0 is cut we should show our positions in both the 1.x and 2.x series. If 2.0 happened after 1.1 (without a 1.2, etc.), that would be:
specs: 1.1.0, 2.0.0
And if the caller explicitly asked for the version information with --version, I think we should be printing it to stdout instead of stderr.
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.
I expect image-tools to support a range of spec versions, not just a single one. For example, once image-spec cuts 2.0, image-tools should still be able to process 1.x images for some reasonable deprecation period. image-spec is setting us up for that possibility by using the v1 package for the Go types that are likely to change. And SemVer means that if we can unpack a 1.3 image, we can also unpack 1.2, 1.1, and 1.0 images. So I think we want this to be printing:
I think this is hard. It's not only the v1 package, the spec define the image layout, how we validate the image, how we unpack the layer... etc, this could be differ from version to version. the tool is a implementation of the spec at some point, the
specs: 0.4.0
means the tool is developed based on the v0.4.0 spec.
After 1.0, I agree to show the supported versions but the tool need to do some backward compatibility thing.
And if the caller explicitly asked for the version information with --version, I think we should be printing it to stdout instead of stderr.
This is a mistake, will fixed.
424990d to
3630b6f
Compare
Signed-off-by: Lei Jitang <[email protected]>
|
On Sun, Sep 18, 2016 at 11:27:36PM -0700, Lei Jitang wrote:
And where there are backwards-incompatible changes, media types should |
|
i like this as a first step. I do not expect the tool to keep a matrix of compatibility support, at least not in the initial stages. And the addition of project URL can be added later. LGTM |
Signed-off-by: Lei Jitang [email protected]
Users should have a way to know the spec version and code commit of
the image-tool