You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@mesos.apache.org by Alexander Rojas <al...@mesosphere.io> on 2017/06/13 14:12:46 UTC

Re: Review Request 59525: Enabled filterirng of reservations.

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

(Updated June 13, 2017, 4:12 p.m.)


Review request for mesos, Adam B, Greg Mann, and Till Toenshoff.


Summary (updated)
-----------------

Enabled filterirng of reservations.


Bugs: MESOS-7416
    https://issues.apache.org/jira/browse/MESOS-7416


Repository: mesos


Description (updated)
-------

Adds support of the 'VIEW_ROLE' ACL to the results generated by the
'/slaves' as well as the 'GET_AGENTS' API v1 call, '/states' and
'/states-summary'.

This means that calls to these endpoints and API call which uses
reservations will only show the reserved resources the user making the
requests is allowed to see based on the reservations roles.


Diffs (updated)
-----

  src/master/http.cpp 1dcfe6ef00b0e3984deb79a511e665f638661323 
  src/master/master.hpp e8ddddf273256b14cde1cac390163f948241757f 
  src/tests/master_tests.cpp 490d7ed4b275ebf5ff6956f7d40dbea3ce3b63e2 


Diff: https://reviews.apache.org/r/59525/diff/4/

Changes: https://reviews.apache.org/r/59525/diff/3-4/


Testing
-------

make check


Thanks,

Alexander Rojas


Re: Review Request 59525: Enabled filtering of reservations.

Posted by Till Toenshoff <to...@me.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/59525/#review179834
-----------------------------------------------------------



Needs a rebase.

- Till Toenshoff


On June 13, 2017, 2:12 p.m., Alexander Rojas wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/59525/
> -----------------------------------------------------------
> 
> (Updated June 13, 2017, 2:12 p.m.)
> 
> 
> Review request for mesos, Adam B, Greg Mann, and Till Toenshoff.
> 
> 
> Bugs: MESOS-7416
>     https://issues.apache.org/jira/browse/MESOS-7416
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Adds support of the 'VIEW_ROLE' ACL to the results generated by the
> '/slaves' as well as the 'GET_AGENTS' API v1 call, '/states' and
> '/states-summary'.
> 
> This means that calls to these endpoints and API call which uses
> reservations will only show the reserved resources the user making the
> requests is allowed to see based on the reservations roles.
> 
> 
> Diffs
> -----
> 
>   src/master/http.cpp 1dcfe6ef00b0e3984deb79a511e665f638661323 
>   src/master/master.hpp e8ddddf273256b14cde1cac390163f948241757f 
>   src/tests/master_tests.cpp 490d7ed4b275ebf5ff6956f7d40dbea3ce3b63e2 
> 
> 
> Diff: https://reviews.apache.org/r/59525/diff/4/
> 
> 
> Testing
> -------
> 
> make check
> 
> 
> Thanks,
> 
> Alexander Rojas
> 
>


Re: Review Request 59525: Enabled filterirng of reservations.

Posted by Mesos Reviewbot Windows <re...@mesos.apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/59525/#review177743
-----------------------------------------------------------



Patch looks great!

Reviews applied: [59453, 58955, 58964, 59099, 59100, 59101, 59147, 59525]

Passed command: support\windows-build.bat

- Mesos Reviewbot Windows


On June 13, 2017, 2:12 p.m., Alexander Rojas wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/59525/
> -----------------------------------------------------------
> 
> (Updated June 13, 2017, 2:12 p.m.)
> 
> 
> Review request for mesos, Adam B, Greg Mann, and Till Toenshoff.
> 
> 
> Bugs: MESOS-7416
>     https://issues.apache.org/jira/browse/MESOS-7416
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Adds support of the 'VIEW_ROLE' ACL to the results generated by the
> '/slaves' as well as the 'GET_AGENTS' API v1 call, '/states' and
> '/states-summary'.
> 
> This means that calls to these endpoints and API call which uses
> reservations will only show the reserved resources the user making the
> requests is allowed to see based on the reservations roles.
> 
> 
> Diffs
> -----
> 
>   src/master/http.cpp 1dcfe6ef00b0e3984deb79a511e665f638661323 
>   src/master/master.hpp e8ddddf273256b14cde1cac390163f948241757f 
>   src/tests/master_tests.cpp 490d7ed4b275ebf5ff6956f7d40dbea3ce3b63e2 
> 
> 
> Diff: https://reviews.apache.org/r/59525/diff/4/
> 
> 
> Testing
> -------
> 
> make check
> 
> 
> Thanks,
> 
> Alexander Rojas
> 
>


Re: Review Request 59525: Enabled filtering of reservations.

Posted by Till Toenshoff <to...@me.com>.

> On July 8, 2017, 1:19 a.m., Greg Mann wrote:
> > src/master/http.cpp
> > Line 380 (original), 380-381 (patched)
> > <https://reviews.apache.org/r/59525/diff/5/?file=1771257#file1771257line380>
> >
> >     To avoid shadowing in constructors, we use leading underscores rather than trailing.

Or even better, use trailing underscores on your members.


> On July 8, 2017, 1:19 a.m., Greg Mann wrote:
> > src/master/http.cpp
> > Lines 2374-2380 (original), 2402-2410 (patched)
> > <https://reviews.apache.org/r/59525/diff/5/?file=1771257#file1771257line2412>
> >
> >     For the used resources, a role can be present in both `resource.role()` and in `resource.allocation_info().role()`. Should we also be filtering based on the allocated role?

Good point - should we?


- Till


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


On July 7, 2017, 3:05 p.m., Alexander Rojas wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/59525/
> -----------------------------------------------------------
> 
> (Updated July 7, 2017, 3:05 p.m.)
> 
> 
> Review request for mesos, Adam B, Greg Mann, and Till Toenshoff.
> 
> 
> Bugs: MESOS-7416
>     https://issues.apache.org/jira/browse/MESOS-7416
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Adds support of the 'VIEW_ROLE' ACL to the results generated by the
> '/slaves' as well as the 'GET_AGENTS' API v1 call, '/states' and
> '/states-summary'.
> 
> This means that calls to these endpoints and API call which uses
> reservations will only show the reserved resources the user making the
> requests is allowed to see based on the reservations roles.
> 
> 
> Diffs
> -----
> 
>   src/master/http.cpp 175a44ce7fb5be509453c25eaa9ec29f35adba3a 
>   src/master/master.hpp 95c2d0fab32d6b60f29a86037607ff009bd78717 
>   src/tests/master_tests.cpp c778c6c56d47c4033189912cebee6024be79106f 
> 
> 
> Diff: https://reviews.apache.org/r/59525/diff/5/
> 
> 
> Testing
> -------
> 
> make check
> 
> 
> Thanks,
> 
> Alexander Rojas
> 
>


Re: Review Request 59525: Enabled filtering of reservations.

Posted by Greg Mann <gr...@mesosphere.io>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/59525/#review179926
-----------------------------------------------------------




src/master/http.cpp
Line 380 (original), 380-381 (patched)
<https://reviews.apache.org/r/59525/#comment254948>

    To avoid shadowing in constructors, we use leading underscores rather than trailing.



src/master/http.cpp
Line 2320 (original), 2330 (patched)
<https://reviews.apache.org/r/59525/#comment254858>

    Now that this is a Writer struct, perhaps it should be moved to the top of the file along with the others?



src/master/http.cpp
Lines 2325-2327 (original), 2333-2336 (patched)
<https://reviews.apache.org/r/59525/#comment254956>

    Ditto here regarding leading underscores.



src/master/http.cpp
Lines 2374-2380 (original), 2402-2410 (patched)
<https://reviews.apache.org/r/59525/#comment254957>

    For the used resources, a role can be present in both `resource.role()` and in `resource.allocation_info().role()`. Should we also be filtering based on the allocated role?



src/master/http.cpp
Lines 2384-2391 (original), 2414-2421 (patched)
<https://reviews.apache.org/r/59525/#comment254950>

    Why aren't we filtering this field as well?



src/master/http.cpp
Lines 3186-3189 (original), 3255-3258 (patched)
<https://reviews.apache.org/r/59525/#comment254958>

    Could you fix the indentation of this lambda? The body should be two spaces indented with respect to the line with the opening curly brace `{`. Or is the indentation unmanageable if we do that here?


- Greg Mann


On July 7, 2017, 3:05 p.m., Alexander Rojas wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/59525/
> -----------------------------------------------------------
> 
> (Updated July 7, 2017, 3:05 p.m.)
> 
> 
> Review request for mesos, Adam B, Greg Mann, and Till Toenshoff.
> 
> 
> Bugs: MESOS-7416
>     https://issues.apache.org/jira/browse/MESOS-7416
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Adds support of the 'VIEW_ROLE' ACL to the results generated by the
> '/slaves' as well as the 'GET_AGENTS' API v1 call, '/states' and
> '/states-summary'.
> 
> This means that calls to these endpoints and API call which uses
> reservations will only show the reserved resources the user making the
> requests is allowed to see based on the reservations roles.
> 
> 
> Diffs
> -----
> 
>   src/master/http.cpp 175a44ce7fb5be509453c25eaa9ec29f35adba3a 
>   src/master/master.hpp 95c2d0fab32d6b60f29a86037607ff009bd78717 
>   src/tests/master_tests.cpp c778c6c56d47c4033189912cebee6024be79106f 
> 
> 
> Diff: https://reviews.apache.org/r/59525/diff/5/
> 
> 
> Testing
> -------
> 
> make check
> 
> 
> Thanks,
> 
> Alexander Rojas
> 
>


Re: Review Request 59525: Enabled filtering of reservations.

Posted by Till Toenshoff <to...@me.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/59525/#review180000
-----------------------------------------------------------


Fix it, then Ship it!




Some small changes needed - please commit after you addressed Greg and my comments.


src/master/http.cpp
Lines 403 (patched)
<https://reviews.apache.org/r/59525/#comment254992>

    A JIRA issue with this would be great as it seems a rather valuable update of this feature.



src/master/http.cpp
Lines 417-418 (patched)
<https://reviews.apache.org/r/59525/#comment254999>

    The more common pattern nowadays for member naming is to use trailing underscores. That way you do not need to disambiguate the constructor arguments - see Gregs comment.
    
    Please also note that the above `FullFrameworkWriter` does use this naming schema as well - so let's do the same here for consistency.



src/master/http.cpp
Lines 2325-2326 (original), 2333-2334 (patched)
<https://reviews.apache.org/r/59525/#comment254995>

    See my comment above.



src/master/http.cpp
Lines 2348 (patched)
<https://reviews.apache.org/r/59525/#comment254996>

    This actually confused me more than it helped due to the fact that the above "registered slaves" are not commented.
    I would suggest to either remove this comment or add a similar one to the above block.



src/master/http.cpp
Lines 2384-2391 (original), 2414-2421 (patched)
<https://reviews.apache.org/r/59525/#comment254998>

    Indeed as Greg comments, let's filter this as well.



src/tests/master_tests.cpp
Lines 2242-2243 (patched)
<https://reviews.apache.org/r/59525/#comment255000>

    Not sure I understand - there is only a single slave being started below, no?


- Till Toenshoff


On July 7, 2017, 3:05 p.m., Alexander Rojas wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/59525/
> -----------------------------------------------------------
> 
> (Updated July 7, 2017, 3:05 p.m.)
> 
> 
> Review request for mesos, Adam B, Greg Mann, and Till Toenshoff.
> 
> 
> Bugs: MESOS-7416
>     https://issues.apache.org/jira/browse/MESOS-7416
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Adds support of the 'VIEW_ROLE' ACL to the results generated by the
> '/slaves' as well as the 'GET_AGENTS' API v1 call, '/states' and
> '/states-summary'.
> 
> This means that calls to these endpoints and API call which uses
> reservations will only show the reserved resources the user making the
> requests is allowed to see based on the reservations roles.
> 
> 
> Diffs
> -----
> 
>   src/master/http.cpp 175a44ce7fb5be509453c25eaa9ec29f35adba3a 
>   src/master/master.hpp 95c2d0fab32d6b60f29a86037607ff009bd78717 
>   src/tests/master_tests.cpp c778c6c56d47c4033189912cebee6024be79106f 
> 
> 
> Diff: https://reviews.apache.org/r/59525/diff/5/
> 
> 
> Testing
> -------
> 
> make check
> 
> 
> Thanks,
> 
> Alexander Rojas
> 
>


Re: Review Request 59525: Enabled filtering of reservations.

Posted by Alexander Rojas <al...@mesosphere.io>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/59525/
-----------------------------------------------------------

(Updated July 11, 2017, 1:26 p.m.)


Review request for mesos, Adam B, Greg Mann, and Till Toenshoff.


Bugs: MESOS-7416
    https://issues.apache.org/jira/browse/MESOS-7416


Repository: mesos


Description
-------

Adds support of the 'VIEW_ROLE' ACL to the results generated by the
'/slaves' as well as the 'GET_AGENTS' API v1 call, '/states' and
'/states-summary'.

This means that calls to these endpoints and API call which uses
reservations will only show the reserved resources the user making the
requests is allowed to see based on the reservations roles.


Diffs (updated)
-----

  src/master/http.cpp 175a44ce7fb5be509453c25eaa9ec29f35adba3a 
  src/master/master.hpp b9b3ea4e5ac9bd067977d4087627a2c7b0e0bfcc 
  src/tests/master_tests.cpp c778c6c56d47c4033189912cebee6024be79106f 


Diff: https://reviews.apache.org/r/59525/diff/6/

Changes: https://reviews.apache.org/r/59525/diff/5-6/


Testing
-------

make check


Thanks,

Alexander Rojas


Re: Review Request 59525: Enabled filtering of reservations.

Posted by Alexander Rojas <al...@mesosphere.io>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/59525/
-----------------------------------------------------------

(Updated July 7, 2017, 5:05 p.m.)


Review request for mesos, Adam B, Greg Mann, and Till Toenshoff.


Changes
-------

Rebased based on the changes of reservations.


Bugs: MESOS-7416
    https://issues.apache.org/jira/browse/MESOS-7416


Repository: mesos


Description
-------

Adds support of the 'VIEW_ROLE' ACL to the results generated by the
'/slaves' as well as the 'GET_AGENTS' API v1 call, '/states' and
'/states-summary'.

This means that calls to these endpoints and API call which uses
reservations will only show the reserved resources the user making the
requests is allowed to see based on the reservations roles.


Diffs (updated)
-----

  src/master/http.cpp 175a44ce7fb5be509453c25eaa9ec29f35adba3a 
  src/master/master.hpp 95c2d0fab32d6b60f29a86037607ff009bd78717 
  src/tests/master_tests.cpp c778c6c56d47c4033189912cebee6024be79106f 


Diff: https://reviews.apache.org/r/59525/diff/5/

Changes: https://reviews.apache.org/r/59525/diff/4-5/


Testing
-------

make check


Thanks,

Alexander Rojas