You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@mesos.apache.org by Meng Zhu <mz...@mesosphere.io> on 2018/02/28 21:00:31 UTC

Review Request 65844: Added `upgradeResource` to some resource parsing functions.

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

Review request for mesos, Benjamin Mahler and Michael Park.


Repository: mesos


Description
-------

Currently only `Resources::parse()` calls `upgradeResource()`,
but the actual parsing functions `Resources::fromJSON()` and
`Resources::fromSimpleString()` which are also public utilities
do not, this may produce invalid resource objects.

This patch moves the `upgradeResource()` to the two internal
parsing functions, so that all resource objects parsed are
valid.


Diffs
-----

  src/common/resources.cpp a0c29246b3e3b377aabd0eb00ba16aa6bbd804e3 


Diff: https://reviews.apache.org/r/65844/diff/1/


Testing
-------

make check


Thanks,

Meng Zhu


Re: Review Request 65844: Added `upgradeResource` to some resource parsing functions.

Posted by Benjamin Mahler <bm...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/65844/#review198500
-----------------------------------------------------------


Ship it!




This looks like a test was missing? Can you add a test that would have caught the issue?

- Benjamin Mahler


On Feb. 28, 2018, 9 p.m., Meng Zhu wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/65844/
> -----------------------------------------------------------
> 
> (Updated Feb. 28, 2018, 9 p.m.)
> 
> 
> Review request for mesos, Benjamin Mahler and Michael Park.
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Currently only `Resources::parse()` calls `upgradeResource()`,
> but the actual parsing functions `Resources::fromJSON()` and
> `Resources::fromSimpleString()` which are also public utilities
> do not, this may produce invalid resource objects.
> 
> This patch moves the `upgradeResource()` to the two internal
> parsing functions, so that all resource objects parsed are
> valid.
> 
> 
> Diffs
> -----
> 
>   src/common/resources.cpp a0c29246b3e3b377aabd0eb00ba16aa6bbd804e3 
> 
> 
> Diff: https://reviews.apache.org/r/65844/diff/1/
> 
> 
> Testing
> -------
> 
> make check
> 
> 
> Thanks,
> 
> Meng Zhu
> 
>