mirror of
https://github.com/k8snetworkplumbingwg/multus-cni.git
synced 2025-08-31 08:33:06 +00:00
Merge and updated the PR#8 (#27)
* Fix retrying DEL failure bug * bug fix for consuming net conf file doesn't exist Change-Id: I810dc308285437d167fa74ca1f63c71dad999f26
This commit is contained in:
committed by
GitHub
parent
a0c23d3ed9
commit
91f7c7c02d
@@ -125,12 +125,7 @@ func consumeScratchNetConf(containerID, dataDir string) ([]byte, error) {
|
||||
path := filepath.Join(dataDir, containerID)
|
||||
defer os.Remove(path)
|
||||
|
||||
data, err := ioutil.ReadFile(path)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to read container data in the path(%q): %v", path, err)
|
||||
}
|
||||
|
||||
return data, err
|
||||
return ioutil.ReadFile(path)
|
||||
}
|
||||
|
||||
func getifname() (f func() string) {
|
||||
@@ -547,6 +542,10 @@ func cmdDel(args *skel.CmdArgs) error {
|
||||
if in.Kubeconfig == "" || nopodnet {
|
||||
netconfBytes, err := consumeScratchNetConf(args.ContainerID, in.CNIDir)
|
||||
if err != nil {
|
||||
if os.IsNotExist(err) {
|
||||
// Per spec should ignore error if resources are missing / already removed
|
||||
return nil
|
||||
}
|
||||
return fmt.Errorf("Multus: Err in reading the delegates: %v", err)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user