> On March 21, 2016, 3:06 a.m., Jie Yu wrote:
> > src/slave/containerizer/mesos/isolators/network/cni/cni.hpp, line 82
> > <https://reviews.apache.org/r/44514/diff/5/?file=1304896#file1304896line82>
> >
> > s/NetworkResultInfo/Info/
> >
> > We typically use 'Info' to store information about each container in
> > isolators.
> >
> > We can then have a hashmap from network name to a another data
> > structure in Info to represent the networks the container has joined.
> >
> > ```
> > // Information about a network that a container has joined.
> > struct NetworkInfo
> > {
> > string ifname;
> > cni::NetworkResult result;
> > };
> >
> > struct Info
> > {
> > hashmap<string, NetworkInfo> networkInfos;
> > };
> > ```
Are we going to support the use case that one container joins one CNI network
multiple times? If yes, then I think we may need to use `vector` rather than
`hashmap` in `struct Info`, like this:
struct NetworkResultInfo
{
// CNI network name.
std::string name;
// Interface name.
const std::string ifname;
// Protobuf of CNI network result returned by CNI plugin
Option<cni::NetworkResult> result;
};
struct Info
{
std::vector<NetworkResultInfo> networkInfos;
};
- Qian
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/44514/#review124451
-----------------------------------------------------------
On March 18, 2016, 2:31 p.m., Qian Zhang wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/44514/
> -----------------------------------------------------------
>
> (Updated March 18, 2016, 2:31 p.m.)
>
>
> Review request for mesos, Avinash sridharan, Gilbert Song, and Jie Yu.
>
>
> Bugs: MESOS-4759
> https://issues.apache.org/jira/browse/MESOS-4759
>
>
> Repository: mesos
>
>
> Description
> -------
>
> Implemented prepare() method of "network/cni" isolator.
>
>
> Diffs
> -----
>
> src/slave/containerizer/mesos/isolators/network/cni/cni.hpp PRE-CREATION
> src/slave/containerizer/mesos/isolators/network/cni/cni.cpp PRE-CREATION
>
> Diff: https://reviews.apache.org/r/44514/diff/
>
>
> Testing
> -------
>
> make check
>
>
> Thanks,
>
> Qian Zhang
>
>