mesos-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jie Yu <yujie....@gmail.com>
Subject Re: Review Request 51097: Added a `PortMapper` class.
Date Sat, 03 Sep 2016 21:36:44 GMT

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


Fix it, then Ship it!




I made a bunch of edit while committing since I probably don't have time to do review back
and forth. Please do take a look at the final patch.

Please follow up with patches if you don't agree on some of the changes.

Also, please rebase the subsequent patches accordingly.


src/slave/containerizer/mesos/isolators/network/cni/spec.hpp (lines 20 - 21)
<https://reviews.apache.org/r/51097/#comment214814>

    swap these two.



src/Makefile.am (lines 1046 - 1047)
<https://reviews.apache.org/r/51097/#comment214945>

    Can you align the tailing back slashes for `MESOS_LINUX_FILES` (ditto below).



src/slave/containerizer/mesos/isolators/network/cni/plugins/port_mapper/main.cpp (line 58)
<https://reviews.apache.org/r/51097/#comment214948>

    I'd declare an error code constant in PortMapper and use it here (instead of relying on
a general default value).



src/slave/containerizer/mesos/isolators/network/cni/plugins/port_mapper/port_mapper.hpp (line
60)
<https://reviews.apache.org/r/51097/#comment214949>

    no need to use leading underscore for the parameter.



src/slave/containerizer/mesos/isolators/network/cni/spec.hpp (line 35)
<https://reviews.apache.org/r/51097/#comment214947>

    This is not in the CNI spec. Why we have it here?



src/slave/containerizer/mesos/isolators/network/cni/spec.hpp (lines 37 - 40)
<https://reviews.apache.org/r/51097/#comment214946>

    This is a non-POD global variable. We try to avoid that. Also, why we need this?


- Jie Yu


On Sept. 2, 2016, 10:33 p.m., Avinash sridharan wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/51097/
> -----------------------------------------------------------
> 
> (Updated Sept. 2, 2016, 10:33 p.m.)
> 
> 
> Review request for mesos, Jie Yu and Qian Zhang.
> 
> 
> Bugs: MESOS-6023
>     https://issues.apache.org/jira/browse/MESOS-6023
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> This class will embody the logic for implementing the CNI port-mapper
> plugin.
> 
> Also added helper functions in `cni::spec` to be able to log CNI
> plugin error as a JSON formatted string of `spec::error`.
> 
> 
> Diffs
> -----
> 
>   src/Makefile.am 120a715eeeb7fb222d1169500950b5c7643df554 
>   src/slave/containerizer/mesos/isolators/network/cni/plugins/port_mapper/main.cpp PRE-CREATION

>   src/slave/containerizer/mesos/isolators/network/cni/plugins/port_mapper/port_mapper.hpp
PRE-CREATION 
>   src/slave/containerizer/mesos/isolators/network/cni/plugins/port_mapper/port_mapper.cpp
PRE-CREATION 
>   src/slave/containerizer/mesos/isolators/network/cni/spec.hpp e6967415a689184f13d65a986f13b0af54364fb2

>   src/slave/containerizer/mesos/isolators/network/cni/spec.cpp 938a9f3bff2a95c8591450f0edafaddb01833e59

> 
> Diff: https://reviews.apache.org/r/51097/diff/
> 
> 
> Testing
> -------
> 
> Tested the port-mapper with the following CNI config:
> {
>     "name": "mynet",
>     "type": "port-mapper",
>     "chain": "MESOS",
>     "delegate": {
>       "type" : "bridge",
>       "bridge": "cni0",
>       "isGateway": true,
>       "ipMasq": true,
>       "ipam": {
>           "type": "host-local",
>           "subnet": "10.22.0.0/16",
>           "routes": [
>             { "dst": "0.0.0.0/0" }
>           ]
>       }
>     },
>     "args" : {
>       "org.apache.mesos" : {
>         "network_info" : {
>           "port_mappings": {
>             "host_port" : 80,
>             "container_port" : 80
>           }
>         }
>       }
>     }
> }
> 
> and the following environment variables:
> export CNI_COMMAND="ADD"
> export CNI_CONTAINERID="0000000111101110"
> export CNI_PATH="$MESOS_INSTALL:/home/vagrant/dev/go/cni/bin"
> export CNI_IFNAME="eth0"
> export CNI_NETNS="/etc/netns"
> 
> If we remove fields from the above CNI config, or remove certain environment variables
the creation of the `PortMapper` correctly fails. However, if config and environment variables
are passed as is it will create the `PortMapper` correctly.
> 
> 
> Thanks,
> 
> Avinash sridharan
> 
>


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message