mirror of https://github.com/containers/podman.git
Merge pull request #1787 from baude/netstatusrework
correct assignment of networkStatus
This commit is contained in:
commit
c611db2bc0
|
@ -64,20 +64,20 @@ func (r *Runtime) configureNetNS(ctr *Container, ctrNS ns.NetNS) ([]*cnitypes.Re
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
networkStatus := make([]*cnitypes.Result, 1)
|
networkStatus := make([]*cnitypes.Result, 0)
|
||||||
for idx, r := range results {
|
for idx, r := range results {
|
||||||
logrus.Debugf("[%d] CNI result: %v", idx, r.String())
|
logrus.Debugf("[%d] CNI result: %v", idx, r.String())
|
||||||
resultCurrent, err := cnitypes.GetResult(r)
|
resultCurrent, err := cnitypes.GetResult(r)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errors.Wrapf(err, "error parsing CNI plugin result %q: %v", r.String(), err)
|
return nil, errors.Wrapf(err, "error parsing CNI plugin result %q: %v", r.String(), err)
|
||||||
}
|
}
|
||||||
networkStatus = append(ctr.state.NetworkStatus, resultCurrent)
|
networkStatus = append(networkStatus, resultCurrent)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add firewall rules to ensure the container has network access.
|
// Add firewall rules to ensure the container has network access.
|
||||||
// Will not be necessary once CNI firewall plugin merges upstream.
|
// Will not be necessary once CNI firewall plugin merges upstream.
|
||||||
// https://github.com/containernetworking/plugins/pull/75
|
// https://github.com/containernetworking/plugins/pull/75
|
||||||
for _, netStatus := range ctr.state.NetworkStatus {
|
for _, netStatus := range networkStatus {
|
||||||
firewallConf := &firewall.FirewallNetConf{
|
firewallConf := &firewall.FirewallNetConf{
|
||||||
PrevResult: netStatus,
|
PrevResult: netStatus,
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue