> On Dec. 8, 2016, 8:59 p.m., Benjamin Mahler wrote:
> > src/master/http.cpp, lines 210-211
> > <https://reviews.apache.org/r/54529/diff/1/?file=1579754#file1579754line210>
> >
> >     In the case of a multi-role framework with two roles ("role1", "role2") 
> > the json here would display:
> >     
> >     ```
> >     {
> >       "role": "*",
> >       "roles": ["role1", "role2"]
> >     }
> >     ```
> >     
> >     For multi-role frameworks we must show:
> >     
> >     ```
> >     {
> >       // No "role"
> >       "roles": ["role1", "role2"]
> >     }
> >     ```
> >     
> >     For single-role frameworks, we could show either of these:
> >     
> >     ```
> >     {
> >       "role": "role",
> >       "roles": ["role"]
> >     }
> >     
> >     {
> >       "role: "role"
> >     }
> >     ```
> >     
> >     The first option would allow tooling to unconditionally look for 
> > "roles", but the second mirrors what's happening in the protobufs. I'm 
> > inclined to just mirror the protobufs.
> 
> Guangya Liu wrote:
>     For single-role frameworks, why want to show both `role` and `roles` as 
> an option? I think only showing `role` is good enough, as showing `roles` may 
> make someone confused: I did not use multi-role framework, why `roles` here?
>     
>     ```
>     {
>       "role: "role"
>     }
>     ```

@bbmahler: I removed the `role` field for multi-role capable frameworks, and 
went with the first option for non-multi-role capable frameworks.

For clusters non running any multi-role capable frameworks this means that 
existing tooling relying on `role` keeps working.

For clusters with multi-role capable frameworks consumers already need to be 
updated in order to understand `roles`; by mirroring information from `role` 
into `roles` we allow them to just use `roles`. This will make writing consumer 
code less complicated, and also give them a clear path forward when the `role` 
field is finally removed.


- Benjamin


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


On Dec. 9, 2016, 11:09 a.m., Benjamin Bannier wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/54529/
> -----------------------------------------------------------
> 
> (Updated Dec. 9, 2016, 11:09 a.m.)
> 
> 
> Review request for mesos, Benjamin Mahler, Jay Guo, and Guangya Liu.
> 
> 
> Bugs: MESOS-6749
>     https://issues.apache.org/jira/browse/MESOS-6749
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Exposed framework roles in master and agent endpoints.
> 
> 
> Diffs
> -----
> 
>   src/master/http.cpp d8cff310ecadf5bb301af9f2aa47acdf2dcd42d2 
>   src/slave/http.cpp 580a90b5547dd26ac5d26e0fd2fc1471a382f62d 
> 
> Diff: https://reviews.apache.org/r/54529/diff/
> 
> 
> Testing
> -------
> 
> `make check` (OS X), checked on various Linux flavors in internal CI.
> 
> 
> Thanks,
> 
> Benjamin Bannier
> 
>

Reply via email to