> On Sept. 14, 2015, 6:11 p.m., Anand Mazumdar wrote:
> > src/slave/containerizer/provisioners/docker/registry_client.cpp, line 266
> > <https://reviews.apache.org/r/38289/diff/2/?file=1068777#file1068777line266>
> >
> >     Not yours , but can we just do OK().status ?
> 
> Jojy Varghese wrote:
>     never understood the reasoning behind the construct. "OK().status" . I 
> could imagine a const static like Http::OK_STATUS OR a response.isOk(). 
> "OK().status" makes you create a new struct and then do a string comparision. 
> We already have a response object and we should be asing it if it is an OK.

I think the reasoning would be more around `tech-debt` then anything else. I 
think we should create a JIRA if none exists to clean up the status hard-coded 
strings, define them as constants and then make the OK, BadRequest etc structs 
use these constants instead of duplicating them again in the corresponding cpp 
file.

https://github.com/apache/mesos/blob/master/3rdparty/libprocess/src/http.cpp#L77

There might be other alternative approaches too as you mentioned around 
`response.isOk()` etc . But if we have to go down any of them, we should 
alteast strive not to introduce any more "magic" constants , thereby, making 
this easier when we decide to reduce the debt.


- Anand


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


On Sept. 11, 2015, 7:34 p.m., Timothy Chen wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/38289/
> -----------------------------------------------------------
> 
> (Updated Sept. 11, 2015, 7:34 p.m.)
> 
> 
> Review request for mesos and Jojy Varghese.
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Handle bad request in Docker registry client.
> 
> 
> Diffs
> -----
> 
>   src/Makefile.am 8963cea9fd7e3bee450a1059e6383e5ab868a17b 
>   src/slave/containerizer/provisioners/docker/registry_client.hpp 
> PRE-CREATION 
>   src/slave/containerizer/provisioners/docker/registry_client.cpp 
> PRE-CREATION 
>   src/tests/provisioners/docker_provisioner_tests.cpp 
> ff29d562c7f1bd5f0579e97cdbd60c2b2f36329e 
> 
> Diff: https://reviews.apache.org/r/38289/diff/
> 
> 
> Testing
> -------
> 
> make check
> 
> 
> Thanks,
> 
> Timothy Chen
> 
>

Reply via email to