summaryrefslogtreecommitdiff
path: root/libpod/networking.go
diff options
context:
space:
mode:
Diffstat (limited to 'libpod/networking.go')
-rw-r--r--libpod/networking.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/libpod/networking.go b/libpod/networking.go
index 40756cf88..f92b80201 100644
--- a/libpod/networking.go
+++ b/libpod/networking.go
@@ -3,6 +3,7 @@ package libpod
import (
"net"
+ cnitypes "github.com/containernetworking/cni/pkg/types/current"
"github.com/containernetworking/plugins/pkg/ns"
"github.com/cri-o/ocicni/pkg/ocicni"
"github.com/pkg/errors"
@@ -37,12 +38,17 @@ func (r *Runtime) createNetNS(ctr *Container) (err error) {
logrus.Debugf("Made network namespace at %s for container %s", ctrNS.Path(), ctr.ID())
podNetwork := getPodNetwork(ctr.ID(), ctr.Name(), ctrNS.Path(), ctr.config.PortMappings)
- _, err = r.netPlugin.SetUpPod(podNetwork)
+ result, err := r.netPlugin.SetUpPod(podNetwork)
if err != nil {
return errors.Wrapf(err, "error configuring network namespace for container %s", ctr.ID())
}
+ resultStruct := result.(*cnitypes.Result)
+ logrus.Debugf("Response from CNI plugins: %v", resultStruct.String())
+
ctr.state.NetNS = ctrNS
+ ctr.state.IPs = resultStruct.IPs
+ ctr.state.Routes = resultStruct.Routes
return nil
}