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
Add ImageLayoutVersion const #414
Conversation
I'm usually against defining constants to replace string literals, and feel like those same “what do you gain?” arguments apply here too. Having the image-layout version auto-bump seems like it makes it easy to get into trouble. For example if you bump your image-spec dependency and have On the other hand, if you have hard-coded the version string locally, you're only likely to bump the string when you actually bump your implementation. |
e534193
to
1cc5401
Compare
@wking /cc @runcom |
On Mon, Oct 24, 2016 at 11:04:57PM -0700, Lei Jitang wrote:
I don't see how value discovery becomes easier by adding a variable. Are you aiming to make image-layout implementation easier for folks who don't read
Fair enough. I don't think defining this constant is useful, and sloppy implementers could get in trouble if they use it. But sloppy implementers are likely going to get in trouble anyway, and we're all consenting adults ;). If my case against the constant isn't convincing, I won't be terribly put out if the constant lands :p. |
So, i'm wondering whether this ought to have its own variable to be versioned outside of |
Isn't that what this PR is adding? |
no, it is adding an additional versioning, which presumably would then be independent of the spec version presented in the laid out files. |
Right. How is that different from the "outside of specs.Version" you're asking for? Or was your original comment trying to say "I'm not sure we want independent version numbers for image-layout and the spec as a whole"? I think we do want independent versions, because I expect image-layout to be bumped less frequently. |
I'm not particularly in favor of it being versioned independently, but can understand the usefulness in that. |
@coolljt0725 is this still needed? |
Add a ImageLayoutVersion = 1.0.0 const so implementation can refer to rather than hard code in implementation just like https://github.com/containers/image/blob/master/oci/layout/oci_dest.go#L173 ``` if err := ioutil.WriteFile(d.ref.ociLayoutPath(), []byte(`{"imageLayoutVersion": "1.0.0"}`), 0644); err != nil { return err } ``` Signed-off-by: Lei Jitang <leijitang@huawei.com>
1cc5401
to
148bc6c
Compare
@vbatts yes, I think this still needed |
Add a ImageLayoutVersion = 1.0.0 const so implementation can
refer to rather than hard code in implementation just like
https://github.com/containers/image/blob/master/oci/layout/oci_dest.go#L173
Signed-off-by: Lei Jitang leijitang@huawei.com
ping @vbatts