Closed briandealwis closed 3 years ago
We might want to be a little more explicit around what the audience of the limitation. Clients need to know the allowed character set and maximum safe length for tags. Registries need to know the minimum length they need to support.
Clients: (1,128]
Registries: [128,Inf)
So... in order for clients to be able to use at most 128 characters, registries should support at least 128 characters.
We could also sidestep some of these questions with something like:
Throughout this document, `<reference>` must match the [grammar for digests](https://github.com/opencontainers/image-spec/blob/v1.0.1/descriptor.md#digests) or the following regular expression for tags:
`[\w][\w.-]{0,127}`
Oops sorry: these comments ended up in my hidden in my personal email.
@jonjohnsonjr I'm a bit hesitant:
\w
, and RFCs usually use Augmented Backus-Naur Form (ABNF) notation specified in RFC2234. But your regexp showed me that my own regex was incorrect (ok for a tag to start with underscore).128,inf
seems to imply that a registry must support tags that have a minimum of 128 characters?seems to imply that a registry must support tags that have a minimum of 128 characters?
If registries don't support at least 128 characters in a tag, then they will be "broken" from the perspective of a client that expects to be able to use up to 128 characters.
It's basically Postel's Law: clients need to be conservative in what they do, and registries should be liberal in what they accept.
Is that a good idea? Who knows. The bare minimum, IMO, is that registries should support up to 128 characters. Given that clients are probably not prepared to deal with tags longer than 128 characters, maybe registries should also not support longer tags than that, but it seems a little bit limiting...
LGTM but I'm not a maintainer :)
@briandealwis your commit are missing DCO signature
Added a sign-off.
Approval required by 1 of: @caniszczyk, @crosbymichael, @dmcgowan, @jdolitsky, @jzelinskie, @mikebrow, @stevvooe
A tag is defined in the spec as a manifest identifier, but the spec does not define the acceptable representations for a tag. This PR provides a definition for the tag name based on the historical description from
docker tag
.There was no reference to definitions for regular expressions, and other examples used basic regexs, so I didn't use character classes or bounds limits.
Motivated by #52