[systemd-devel] [PATCH 5/5] import/pull-dkr: V2 Image specification + manifest support

Lennart Poettering lennart at poettering.net
Fri May 15 07:32:59 PDT 2015


On Fri, 15.05.15 16:24, Pavel Odvody (podvody at redhat.com) wrote:

> > Also, can you quickly explain how the three servers relate to each
> > other? Is this documented anywhere?
> > 
> 
> I'm currently in the process of rewriting these to use the same domain
> name as is passed in --dkr-index-url, so they'll look like:
> ${PROTOCOL}auth.${ADDRESS}/[v2]/token
> and registry.${ADDRESS} respectively.

Ah, that would be good. Does this mean we can then dervive these URLs
from the index url? that would be good..

> These are somehow documented here:
> https://docs.docker.com/registry/spec/auth/token/

Oh god, this is all so ... baroque...

> > Why the cast? void, and non-const automatically upgrade to const and
> > any type...
> 
> I think that j->payload is uint8_t* and the function expects const
> char*, what do you thing about changing the signature of json_parse to
> 
> int json_parse(const void* payload, size_t size, json_variant **rv);

Ah, you are right. I was confused, ignore what I said here...


> > > +enum PullStrategy { PULL_V1, PULL_V2 };
> > 
> > So far we typedef'ed enums for exported types, and prefixed both with
> > a namespacing prefix. Also, why call this a "strategy"? Does dkr
> > upstream call it that way? Shouldn't this be "protocol" or so?
> > 
> > typedef enum DkrProtocolVersion {
> >        DKR_PROTOCOL_V1,
> >        DKR_PROTOCOL_V2,
> > } DkrProtocolVersion;
> 
> Nope, entirely my choice of a name. Protocol sounds more like switching
> between HTTP/S, FTP or something, while the underlying network protocols
> has stayed the same, only the "strategy" how the image is pulled has
> changed. But I have no problem with changing that.

Maybe call it just DkrVersion? And DKR_VERSION_1, and DKR_VERSION_2?

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list