Modifying fake cni plugin

Signed-off-by: abhi <abhi@docker.com>
This commit is contained in:
abhi
2018-03-14 20:05:46 -07:00
parent 92110e1d74
commit 003bbd4292
5 changed files with 26 additions and 150 deletions

View File

@@ -505,6 +505,10 @@ func (c *criContainerdService) setupPod(id string, path string, config *runtime.
if configs, ok := result.Interfaces[defaultIfName]; ok && len(configs.IPConfigs) > 0 {
return configs.IPConfigs[0].IP.String(), nil
}
// If it comes here then the result was invalid so destroy the pod network and return error
if err := c.teardownPod(id, path, config); err != nil {
logrus.WithError(err).Errorf("Failed to destroy network for sandbox %q", id)
}
return "", fmt.Errorf("failed to find network info for sandbox %q", id)
}