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

(Updated Oct. 13, 2016, 8:32 p.m.)


Review request for mesos, Jie Yu and Qian Zhang.


Changes
-------

Rebased.


Bugs: MESOS-6023
    https://issues.apache.org/jira/browse/MESOS-6023


Repository: mesos


Description
-------

Added `execute` method.


Diffs (updated)
-----

  
src/slave/containerizer/mesos/isolators/network/cni/plugins/port_mapper/port_mapper.hpp
 7fad707a240234e35828917aea1bc79f42fe130e 
  
src/slave/containerizer/mesos/isolators/network/cni/plugins/port_mapper/port_mapper.cpp
 2ff8b0e76a11b6f6c98b839d3ac91a81e41285f5 

Diff: https://reviews.apache.org/r/51486/diff/


Testing
-------

make. 

Created a network namespace using `ip route2` and used the following script to 
test the execution of the 'delegate plugin':
export CNI_COMMAND="DEL"
export CNI_CONTAINERID="0000000111101110"
export CNI_PATH="$MESOS_INSTALL:/home/vagrant/dev/go/cni/bin"
export CNI_IFNAME="eth0"
export CNI_NETNS="/var/run/netns/$1"
$MESOS_SRC/build/src/.libs/mesos-cni-port-mapper < $2
unset CNI_COMMAND
unset CNI_CONTAINERID
unset CNI_PATH
unset CNI_IFNAME
unset CNI_NETNS

Here $1 is the name of the netns created by `ip route2` and $2 is the CNI 
configuration of the port-mapper plugin. We used the following config:
{
    "name": "mynet",
    "type": "port-mapper",
    "chain": "MESOS",
    "delegate": {
      "type" : "bridge",
      "bridge": "cni0",
      "isGateway": true,
      "ipMasq": true,
      "ipam": {
          "type": "host-local",
          "subnet": "192.168.37.0/24",
          "routes": [
            { "dst": "0.0.0.0/0" }
          ]
      }
    },
    "args" : {
      "org.apache.mesos" : {
        "network_info" : {
          "port_mappings": {
            "host_port" : 8090,
            "container_port" : 80
          }
        }
      }
    }
}


Thanks,

Avinash sridharan

Reply via email to