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




src/slave/containerizer/mesos/isolators/network/ports.cpp
Lines 318-324 (original), 318-341 (patched)
<https://reviews.apache.org/r/60766/#comment259468>

    What about merging these two `if` like:
    ```
    if (cniIsolatorEnabled) {
      if (!containerId.has_parent()) {
        // For top-level containers, ...
        if (containerConfig.has_container_info()) {
          foreach (const auto& networkInfo,
                   containerConfig.container_info().network_infos()) {
            if (networkInfo.has_name()) {
              return None();
            }
          }
        }
      } else {
        // For nested containers, ...
        ContainerID rootContainerId = protobuf::getRootContainerId(containerId);
        if (!infos.contains(rootContainerId)) {
          return None();
        }
      }
    }
    
    ```


- Qian Zhang


On Aug. 22, 2017, 6:01 a.m., James Peach wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/60766/
> -----------------------------------------------------------
> 
> (Updated Aug. 22, 2017, 6:01 a.m.)
> 
> 
> Review request for mesos, Qian Zhang and Jiang Yan Xu.
> 
> 
> Bugs: MESOS-7675
>     https://issues.apache.org/jira/browse/MESOS-7675
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Working on the assumption that containers with CNI networks will
> get their own IP addresses and don't need port isolation, ignore
> any containers that are joining CNI networks.
> 
> 
> Diffs
> -----
> 
>   src/slave/containerizer/mesos/containerizer.cpp 
> 5772421c3078d36225b946a5286b8c1bf2f007e8 
>   src/slave/containerizer/mesos/isolators/network/ports.hpp PRE-CREATION 
>   src/slave/containerizer/mesos/isolators/network/ports.cpp PRE-CREATION 
> 
> 
> Diff: https://reviews.apache.org/r/60766/diff/9/
> 
> 
> Testing
> -------
> 
> make check (Fedora 26).
> 
> 
> Thanks,
> 
> James Peach
> 
>

Reply via email to