> On April 8, 2015, 9:19 p.m., Jie Yu wrote:
> > src/common/resources.cpp, line 663
> > <https://reviews.apache.org/r/32149/diff/4/?file=920084#file920084line663>
> >
> >     Do you need to call validate(operation.reserve().resources()) first 
> > (like we did in CREATE/DESTROY)? Do you also want to check if each resource 
> > is dynamically reserved (i.e., has ReservationInfo, role != `*`)?

Both of the checks you mentioned are checked by

```
Option<Error> master::validation::operation::validate(
    const Offer::Operation::Reserve& reserve,
    const string& role,
    const string& principal);
```

which the master calls before performing `apply`.

My thought here was that valid `Operation`s are a pre-condition of `apply` 
because while we can perform validation such as `role != "*"`, we cannot 
perform other necessary validations such as "does the resource's role match the 
framework's role", "does the specified `principal` match the framework's 
`principal`".

What do you think?


- Michael


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


On April 27, 2015, 5:48 p.m., Michael Park wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/32149/
> -----------------------------------------------------------
> 
> (Updated April 27, 2015, 5:48 p.m.)
> 
> 
> Review request for mesos, Alexander Rukletsov, Ben Mahler, and Jie Yu.
> 
> 
> Bugs: MESOS-2477
>     https://issues.apache.org/jira/browse/MESOS-2477
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> See summary.
> 
> 
> Diffs
> -----
> 
>   src/common/resources.cpp 2c99b6884d7296099e19e2e3182cbe11b5e1e059 
>   src/tests/resources_tests.cpp 7e0ad98c3366f647f190363a0e6b576dbfc7d415 
> 
> Diff: https://reviews.apache.org/r/32149/diff/
> 
> 
> Testing
> -------
> 
> make check
> 
> 
> Thanks,
> 
> Michael Park
> 
>

Reply via email to