mirror of
https://github.com/containers/podman.git
synced 2025-05-28 21:46:51 +08:00
Use more reliable function for parsing CNI result
Signed-off-by: Matthew Heon <matthew.heon@gmail.com> Closes: #440 Approved by: baude
This commit is contained in:
@ -42,9 +42,20 @@ func (r *Runtime) createNetNS(ctr *Container) (err error) {
|
||||
if err != nil {
|
||||
return errors.Wrapf(err, "error configuring network namespace for container %s", ctr.ID())
|
||||
}
|
||||
defer func() {
|
||||
if err != nil {
|
||||
if err2 := r.netPlugin.TearDownPod(podNetwork); err2 != nil {
|
||||
logrus.Errorf("Error tearing down partially created network namespace for container %s: %v", ctr.ID(), err2)
|
||||
}
|
||||
}
|
||||
}()
|
||||
|
||||
resultStruct := result.(*cnitypes.Result)
|
||||
logrus.Debugf("Response from CNI plugins: %v", resultStruct.String())
|
||||
logrus.Debugf("Response from CNI plugins: %v", result.String())
|
||||
|
||||
resultStruct, err := cnitypes.GetResult(result)
|
||||
if err != nil {
|
||||
return errors.Wrapf(err, "error parsing result from CBI plugins")
|
||||
}
|
||||
|
||||
ctr.state.NetNS = ctrNS
|
||||
ctr.state.IPs = resultStruct.IPs
|
||||
|
Reference in New Issue
Block a user