-
Notifications
You must be signed in to change notification settings - Fork 395
Follow the OCI Image specification for the contents of a ref-name #323
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
|
Pretty much the same we're going to do here #318 (comment) I'm fine merging this and have #318 rebased. |
|
@mtrmac wdyt? |
90087b5 to
46b313d
Compare
|
Will fix up the tests and update |
org.opencontainers.image.ref.name values are allowed to be much more complex than the code allowed for. Change the validation to match the spec. Since ref-names can contain a :, split from the path on the first :, not the last :. (Path containing a : were already considered invalid.) fixes containers#294 Signed-off-by: Owen W. Taylor <otaylor@fishsoup.net>
46b313d to
98f428e
Compare
|
In effect, this is really the same as #318 - #318 looks a lot more complicated because it renames 'tag' to 'image' and changes some details of the semantics, but the basic changes of: A) Validating ref-names against the image spec are the same. So I don't really think it makes sense to land both of them. If the details of #318 can be improved a bit, I'm happy if that is landed instead of this. |
|
The problem with this is that now we can't support directories that have |
|
That definitely is a good point. Paths with ':' were previously in a gray zone - if you added an explicit tag to them, writing The nice thing about URI syntax is that arbitrary path would be allowed - the bad thing is that you need URI encoding to generate the reference for arbitrary paths - if your path has
An alternate to URI syntax would be using |
That's actually not true,
That might work. My reason for suggesting URI syntax is because |
Huh - a feature of Bourne shell syntax that I never noticed in 20+ years... :-) You could use # without going full-on-URI-parsing, but making things look more like URI's, without parsing them as URIs' is probably not an improvement - at least |
<rant> Yeah, in-band signaling (special semantics characters inside a string) is always painful, if not always a bad idea. Sometimes I really wish the UNIX ”Write programs to handle text streams, because that is a universal interface.” thing was recognized to be the quick hack suitable for 16-bit machines that it is, just like silently truncating lines longer than 80 characters, instead of some wise philosophy; then we would have no text formatting and parsing, and everything were well-typed data. But that would force us to write GUIs with folder selection for directories, and the like, instead of CLIs; or force users to use well-typed programming languages; neither is practically possible given the number of programmers working on this, and the existing ecosystems the software needs to work with. </rant> Guessing without any data, most users of the text format will probably not be that careful to read the documentation in full detail, to always perfectly escape, etc.; so the practical effect is that the separator character/string is, for most users, forbidden, and the escape mechanisms, if any, will be used by few users—it might even be an unwelcome surprise to the naive shell users just concatenating strings. Also, every image identity, or at least its namespaces, need to be representable in the policy configuration, and that policy configuration should not be confusing to users; so it’s not just a matter of allowing an API call with arbitrary inputs when the text format is not used for input, we need to be able to format even the API-created references in an unambiguous and well-readable way for the policy. URI encoding in the policy is… possible, but it would be nice to be able to do without. So I’m leaning towards the plain But this is a quite weakly held opinion; I might well be wrong and a critical user of |
|
If you ever want to support windows, then prohibiting And I agree that users aren't going to read documentation carefully, so if there's a normal way to do it that mostly works (concatenate strings), and an extra hoop that is safe for all paths (escape, add a trailing separator) - you don't gain much ecosystem robustness. Requiring a trailing separator for a ref_name-less reference - (*) a separator that can't appear in a ref-name - you still have to be able to break |
|
(Shouldn’t this conversation happen mostly in #318?)
Good point—but, actually, using Windows-reserved characters is somewhat desirable; UNIX allows almost anything in paths, but Windows does have a few reserved characters, and those are pretty unlikely to appear in the NAS paths and other kinds of pre-determined paths which can’t be changed. Of the Windows-reserved characters,
Yeah… OTOH #318, and #155 , are moving |
org.opencontainers.image.ref.name values are allowed to be much more complex
than the code allowed for. Change the validation to match the spec. Since
ref-names can contain a :, split from the path on the first :, not the
last :. (Path containing a : were already considered invalid.)
fixes #294