mesos-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James Peach <jpe...@apache.org>
Subject Re: Review Request 71441: Fixed Docker registry malformed URI contruction.
Date Sun, 15 Sep 2019 00:10:23 GMT


> On Sept. 13, 2019, 3:39 p.m., Andrei Budnik wrote:
> > src/uri/utils.cpp
> > Line 31 (original), 31 (patched)
> > <https://reviews.apache.org/r/71441/diff/2/?file=2164341#file2164341line31>
> >
> >     According to https://en.wikipedia.org/wiki/Uniform_Resource_Identifier#Definition
two slashes `//` are only specified if `host` is provided. The previous version of `<<`
operator conforms the URI syntax:
> >     ```
> >     If an authority component is present, then the path component must either be
empty or begin with a slash (/).
> >     ```
> >     
> >     Should `mesos::uri::docker::manifest` (+`image` and `blob`) be fixed instead
of this `<<` operator? I'd expect it to handle the case when the first slash `/` is
not contained in the non-empty `repository` (but the `host` is specified), so that it would
pass a proper `path` to the `uri::construct` method.

If I read that correctly, the authority portion is optional, so it is OK to include it if
there is no authority. For example, `file:` URLs [RFC-8089](https://tools.ietf.org/html/rfc8089)
can include the `://` for absolute paths, like `file:///etc/resolv.conf`.

This implementation is consistent with the libprocess `URL` implementation [here](https://github.com/apache/mesos/blob/master/3rdparty/libprocess/src/http.cpp#L945).
In this case, we have always assumed that there is a scheme present.

Standards arguments aside, I think that this is fine for 99.99% of cases we care about (http,
https and file schemes) :)


- James


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/71441/#review217726
-----------------------------------------------------------


On Sept. 6, 2019, 6:20 a.m., James Peach wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/71441/
> -----------------------------------------------------------
> 
> (Updated Sept. 6, 2019, 6:20 a.m.)
> 
> 
> Review request for mesos, Gilbert Song and Jie Yu.
> 
> 
> Bugs: MESOS-9963
>     https://issues.apache.org/jira/browse/MESOS-9963
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> If a non-default Docker registry is used for container image, the Docker
> puller would omit the separator between the hostname and the path when
> constructing the final URI.
> 
> 
> Diffs
> -----
> 
>   src/tests/containerizer/docker_spec_tests.cpp 4be0716895132e0406299f7d77f8ceb2d95dbe8a

>   src/tests/uri_tests.cpp 1d33ab110bed7c0b7ecfa5d608965da5a1729562 
>   src/uri/utils.cpp 3940dc041c1783eec9e7c950402fd7c42e620d8e 
> 
> 
> Diff: https://reviews.apache.org/r/71441/diff/2/
> 
> 
> Testing
> -------
> 
> make check (Fedora 30)
> 
> 
> Thanks,
> 
> James Peach
> 
>


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message