----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/32150/#review79442 -----------------------------------------------------------
src/master/validation.cpp <https://reviews.apache.org/r/32150/#comment128811> Do you want to add a `CHECK_NE(resource.role(), "*");` here. That makes me wonder should we move the check in Resources::validate about `"*"` and `ReservationInfo` here. This sounds like a more high level semantical check, while checks in Resources::validate are all quite low level (e.g., check for invalid name, type name mismatch, etc.). What do you think? src/master/validation.cpp <https://reviews.apache.org/r/32150/#comment128812> We typically uses single quote in our code base: ``` The reserved resource's role 'xxx' does not... ``` That can also help us avoid the escape char '\'. src/master/validation.cpp <https://reviews.apache.org/r/32150/#comment128820> Is this necessary, or will be captured by the resources contains check later? src/tests/master_validation_tests.cpp <https://reviews.apache.org/r/32150/#comment128827> Can you split this test into a few smaller tests (i.e., one for each {} block)? The comment in each {} block can be the test name. In that way, when a test fails, you immediately know what went wrong. What do you think? src/tests/master_validation_tests.cpp <https://reviews.apache.org/r/32150/#comment128824> Can we get rid of this temp variable (to be consistent with the `"*"` case below)? src/tests/master_validation_tests.cpp <https://reviews.apache.org/r/32150/#comment128828> Ditto on temp variable and splitting into smaller tests. src/tests/master_validation_tests.cpp <https://reviews.apache.org/r/32150/#comment128822> Add quote to 'principal'. ``` // 'principal' matches. ``` - Jie Yu On April 8, 2015, 5:04 p.m., Michael Park wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/32150/ > ----------------------------------------------------------- > > (Updated April 8, 2015, 5:04 p.m.) > > > Review request for mesos, Alexander Rukletsov, Ben Mahler, and Jie Yu. > > > Bugs: MESOS-2139 > https://issues.apache.org/jira/browse/MESOS-2139 > > > Repository: mesos > > > Description > ------- > > Handled reservation operations in `Master::_accept`. > > Added `validate` functions in `src/master/validation.{hpp,cpp}`. > > > Diffs > ----- > > src/master/master.cpp 618db68ee4163b06e479cf3413eda4b63c9c5a4b > src/master/validation.hpp 2d7416c053f82d6316542fa9c35b0e7bc605abec > src/master/validation.cpp 2f2e4ea8ea123c5a0d01446cdec8b308ea60932e > src/tests/master_validation_tests.cpp > 4f2ad58c3ae0f611fb476c4d91a37dd6a5541395 > > Diff: https://reviews.apache.org/r/32150/diff/ > > > Testing > ------- > > make check > > > Thanks, > > Michael Park > >
