You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@mesos.apache.org by Neil Conway <ne...@gmail.com> on 2015/11/06 00:59:22 UTC

Re: Review Request 35711: Disallow special characters in role name.

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


Can we add an end-to-end unit test that verifies that attempting to register as a framework with an invalid role name results in an error?


include/mesos/roles.hpp (line 46)
<https://reviews.apache.org/r/35711/#comment163836>

    Extra whitespace before period.



include/mesos/roles.hpp (line 51)
<https://reviews.apache.org/r/35711/#comment163846>

    Should this be a member function? i.e., not static.



include/mesos/roles.hpp (line 53)
<https://reviews.apache.org/r/35711/#comment163858>

    Is this necessary?



include/mesos/roles.hpp (line 55)
<https://reviews.apache.org/r/35711/#comment163837>

    Capitalization, punctuation.



include/mesos/roles.hpp (line 58)
<https://reviews.apache.org/r/35711/#comment163838>

    Same as above.



include/mesos/roles.hpp (line 59)
<https://reviews.apache.org/r/35711/#comment163845>

    Is this necessary?



include/mesos/roles.hpp (line 61)
<https://reviews.apache.org/r/35711/#comment163857>

    Is this necessary?



include/mesos/roles.hpp (line 63)
<https://reviews.apache.org/r/35711/#comment163888>

    Is this necessary?



src/common/roles.cpp (line 19)
<https://reviews.apache.org/r/35711/#comment163852>

    If we're including roles.hpp, we can omit including the headers it includes, I'd think.



src/common/roles.cpp (line 67)
<https://reviews.apache.org/r/35711/#comment163842>

    Error message is inaccurate.



src/common/roles.cpp (line 90)
<https://reviews.apache.org/r/35711/#comment163844>

    Why are some trivial member functions/constructors define in the .cpp, whereas others are defined in the header file?



src/tests/roles_tests.cpp (line 29)
<https://reviews.apache.org/r/35711/#comment163892>

    This can be removed.


- Neil Conway


On Oct. 3, 2015, 4:11 p.m., haosdent huang wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/35711/
> -----------------------------------------------------------
> 
> (Updated Oct. 3, 2015, 4:11 p.m.)
> 
> 
> Review request for mesos, Adam B, Jie Yu, and Michael Park.
> 
> 
> Bugs: MESOS-2210
>     https://issues.apache.org/jira/browse/MESOS-2210
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Disallow special characters in role name.
> 
> 
> Diffs
> -----
> 
>   include/mesos/roles.hpp PRE-CREATION 
>   src/Makefile.am f060998bb08cdb071db5a2e85dfbad805dab45e9 
>   src/common/resources.cpp 601388c35a1bff37c58e753d1870d53b8d0af2d1 
>   src/common/roles.cpp PRE-CREATION 
>   src/master/flags.cpp 0285ce70cefca09e81ef7137968d024e297fec87 
>   src/master/master.hpp 4bb65f0b6b77ea7324b0dee943602cfdb0f6a11c 
>   src/master/master.cpp 6bee4f351c3fd0fb72f64bbc863968e4786b318b 
>   src/slave/flags.cpp 029aa1eb00e1aa3e92c2155925022c17fd905862 
>   src/tests/resources_tests.cpp 6584fc6c39e6ffe9f8085576677dcc669f127697 
>   src/tests/roles_tests.cpp PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/35711/diff/
> 
> 
> Testing
> -------
> 
> make -j8 check
> 
> 
> Thanks,
> 
> haosdent huang
> 
>


Re: Review Request 35711: Disallow special characters in role name.

Posted by Adam B <ad...@mesosphere.io>.

> On Nov. 5, 2015, 3:59 p.m., Neil Conway wrote:
> > Can we add an end-to-end unit test that verifies that attempting to register as a framework with an invalid role name results in an error?

Attempting to register with an unrecognized role name will fail long before we get to creating a directory for it on the slave. Rather, the validation/testing needs to happen when we add a new role, which currently only happens on master startup with `--roles`.
We could/should have a test for a framework attempting to register with an unrecognized role, but that's unrelated to this patch.


- Adam


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


On Oct. 3, 2015, 9:11 a.m., haosdent huang wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/35711/
> -----------------------------------------------------------
> 
> (Updated Oct. 3, 2015, 9:11 a.m.)
> 
> 
> Review request for mesos, Adam B, Jie Yu, and Michael Park.
> 
> 
> Bugs: MESOS-2210
>     https://issues.apache.org/jira/browse/MESOS-2210
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Disallow special characters in role name.
> 
> 
> Diffs
> -----
> 
>   include/mesos/roles.hpp PRE-CREATION 
>   src/Makefile.am f060998bb08cdb071db5a2e85dfbad805dab45e9 
>   src/common/resources.cpp 601388c35a1bff37c58e753d1870d53b8d0af2d1 
>   src/common/roles.cpp PRE-CREATION 
>   src/master/flags.cpp 0285ce70cefca09e81ef7137968d024e297fec87 
>   src/master/master.hpp 4bb65f0b6b77ea7324b0dee943602cfdb0f6a11c 
>   src/master/master.cpp 6bee4f351c3fd0fb72f64bbc863968e4786b318b 
>   src/slave/flags.cpp 029aa1eb00e1aa3e92c2155925022c17fd905862 
>   src/tests/resources_tests.cpp 6584fc6c39e6ffe9f8085576677dcc669f127697 
>   src/tests/roles_tests.cpp PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/35711/diff/
> 
> 
> Testing
> -------
> 
> make -j8 check
> 
> 
> Thanks,
> 
> haosdent huang
> 
>


Re: Review Request 35711: Disallow special characters in role name.

Posted by haosdent huang <ha...@gmail.com>.

> On Nov. 5, 2015, 11:59 p.m., Neil Conway wrote:
> > include/mesos/roles.hpp, line 51
> > <https://reviews.apache.org/r/35711/diff/15/?file=1089392#file1089392line51>
> >
> >     Should this be a member function? i.e., not static.

When I write this, I refer to the static validate method in Resources. Is it better to make it as a member function?


> On Nov. 5, 2015, 11:59 p.m., Neil Conway wrote:
> > include/mesos/roles.hpp, line 53
> > <https://reviews.apache.org/r/35711/diff/15/?file=1089392#file1089392line53>
> >
> >     Is this necessary?

Because we have `Resources() {}`, I still keep it here.


> On Nov. 5, 2015, 11:59 p.m., Neil Conway wrote:
> > include/mesos/roles.hpp, line 59
> > <https://reviews.apache.org/r/35711/diff/15/?file=1089392#file1089392line59>
> >
> >     Is this necessary?

ditto


> On Nov. 5, 2015, 11:59 p.m., Neil Conway wrote:
> > include/mesos/roles.hpp, line 61
> > <https://reviews.apache.org/r/35711/diff/15/?file=1089392#file1089392line61>
> >
> >     Is this necessary?

ditto


> On Nov. 5, 2015, 11:59 p.m., Neil Conway wrote:
> > include/mesos/roles.hpp, line 63
> > <https://reviews.apache.org/r/35711/diff/15/?file=1089392#file1089392line63>
> >
> >     Is this necessary?

ditto


> On Nov. 5, 2015, 11:59 p.m., Neil Conway wrote:
> > src/common/roles.cpp, line 67
> > <https://reviews.apache.org/r/35711/diff/15/?file=1089395#file1089395line67>
> >
> >     Error message is inaccurate.

`inaccurate` means we should change `invalid` to `illegal`, or what description would be better here?


- haosdent


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


On Dec. 12, 2015, 2:29 p.m., haosdent huang wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/35711/
> -----------------------------------------------------------
> 
> (Updated Dec. 12, 2015, 2:29 p.m.)
> 
> 
> Review request for mesos, Adam B, Jie Yu, and Michael Park.
> 
> 
> Bugs: MESOS-2210
>     https://issues.apache.org/jira/browse/MESOS-2210
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Disallow special characters in role name.
> 
> 
> Diffs
> -----
> 
>   include/mesos/roles.hpp PRE-CREATION 
>   src/CMakeLists.txt 0d46043dd06007f2cba56626c82e8edd251cb8fb 
>   src/Makefile.am 9762f8567e32d70b8df2d694a1fef5c692fc730e 
>   src/common/resources.cpp 5a7981744726a0544435cbbd5007487a43a01211 
>   src/common/roles.cpp PRE-CREATION 
>   src/master/flags.cpp f9223edb33483cb5619e7dd75221f735306462c6 
>   src/master/master.hpp 9aa548aa6e159046c94e4ec96f631ea8b3bfd5d8 
>   src/master/master.cpp 0d1482279c68f2a4a27dabaf28774769a5d515c4 
>   src/slave/flags.cpp c4343ab7ff7b7b4d2c335119d41319b0779d2806 
>   src/tests/resources_tests.cpp ce47bac73937a6a608016f46121137d6116c1399 
>   src/tests/roles_tests.cpp PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/35711/diff/
> 
> 
> Testing
> -------
> 
> make -j8 check
> 
> 
> Thanks,
> 
> haosdent huang
> 
>