mirror of
https://github.com/k8snetworkplumbingwg/multus-cni.git
synced 2025-09-04 18:31:44 +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)
|
path := filepath.Join(dataDir, containerID)
|
||||||
defer os.Remove(path)
|
defer os.Remove(path)
|
||||||
|
|
||||||
data, err := ioutil.ReadFile(path)
|
return 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
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func getifname() (f func() string) {
|
func getifname() (f func() string) {
|
||||||
@@ -547,6 +542,10 @@ func cmdDel(args *skel.CmdArgs) error {
|
|||||||
if in.Kubeconfig == "" || nopodnet {
|
if in.Kubeconfig == "" || nopodnet {
|
||||||
netconfBytes, err := consumeScratchNetConf(args.ContainerID, in.CNIDir)
|
netconfBytes, err := consumeScratchNetConf(args.ContainerID, in.CNIDir)
|
||||||
if err != nil {
|
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)
|
return fmt.Errorf("Multus: Err in reading the delegates: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user