Skip to content

Commit a1afd0d

Browse files
silencepermccv1r0
authored andcommitted
Signed-off-by: silenceper <[email protected]>
1 parent 930a74e commit a1afd0d

File tree

7 files changed

+66
-1
lines changed

7 files changed

+66
-1
lines changed

plugins/main/bridge/bridge.go

+7
Original file line numberDiff line numberDiff line change
@@ -672,6 +672,13 @@ func cmdDel(args *skel.CmdArgs) error {
672672
})
673673

674674
if err != nil {
675+
// if NetNs is passed down by the Cloud Orchestration Engine, or if it called multiple times
676+
// so don't return an error if the device is already removed.
677+
// https://github.com/kubernetes/kubernetes/issues/43014#issuecomment-287164444
678+
_, ok := err.(ns.NSPathNotExistErr)
679+
if ok {
680+
return nil
681+
}
675682
return err
676683
}
677684

plugins/main/ipvlan/ipvlan.go

+11
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,17 @@ func cmdDel(args *skel.CmdArgs) error {
310310
return nil
311311
})
312312

313+
if err != nil {
314+
// if NetNs is passed down by the Cloud Orchestration Engine, or if it called multiple times
315+
// so don't return an error if the device is already removed.
316+
// https://github.com/kubernetes/kubernetes/issues/43014#issuecomment-287164444
317+
_, ok := err.(ns.NSPathNotExistErr)
318+
if ok {
319+
return nil
320+
}
321+
return err
322+
}
323+
313324
return err
314325
}
315326

plugins/main/loopback/loopback.go

+8-1
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,14 @@ func cmdDel(args *skel.CmdArgs) error {
159159
return nil
160160
})
161161
if err != nil {
162-
return err // not tested
162+
// if NetNs is passed down by the Cloud Orchestration Engine, or if it called multiple times
163+
// so don't return an error if the device is already removed.
164+
// https://github.com/kubernetes/kubernetes/issues/43014#issuecomment-287164444
165+
_, ok := err.(ns.NSPathNotExistErr)
166+
if ok {
167+
return nil
168+
}
169+
return err
163170
}
164171

165172
return nil

plugins/main/macvlan/macvlan.go

+11
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,17 @@ func cmdDel(args *skel.CmdArgs) error {
367367
return nil
368368
})
369369

370+
if err != nil {
371+
// if NetNs is passed down by the Cloud Orchestration Engine, or if it called multiple times
372+
// so don't return an error if the device is already removed.
373+
// https://github.com/kubernetes/kubernetes/issues/43014#issuecomment-287164444
374+
_, ok := err.(ns.NSPathNotExistErr)
375+
if ok {
376+
return nil
377+
}
378+
return err
379+
}
380+
370381
return err
371382
}
372383

plugins/main/ptp/ptp.go

+7
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,13 @@ func cmdDel(args *skel.CmdArgs) error {
292292
})
293293

294294
if err != nil {
295+
// if NetNs is passed down by the Cloud Orchestration Engine, or if it called multiple times
296+
// so don't return an error if the device is already removed.
297+
// https://github.com/kubernetes/kubernetes/issues/43014#issuecomment-287164444
298+
_, ok := err.(ns.NSPathNotExistErr)
299+
if ok {
300+
return nil
301+
}
295302
return err
296303
}
297304

plugins/main/vlan/vlan.go

+11
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,17 @@ func cmdDel(args *skel.CmdArgs) error {
213213
return err
214214
})
215215

216+
if err != nil {
217+
// if NetNs is passed down by the Cloud Orchestration Engine, or if it called multiple times
218+
// so don't return an error if the device is already removed.
219+
// https://github.com/kubernetes/kubernetes/issues/43014#issuecomment-287164444
220+
_, ok := err.(ns.NSPathNotExistErr)
221+
if ok {
222+
return nil
223+
}
224+
return err
225+
}
226+
216227
return err
217228
}
218229

plugins/meta/vrf/main.go

+11
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,17 @@ func cmdDel(args *skel.CmdArgs) error {
123123
return nil
124124
})
125125

126+
if err != nil {
127+
// if NetNs is passed down by the Cloud Orchestration Engine, or if it called multiple times
128+
// so don't return an error if the device is already removed.
129+
// https://github.com/kubernetes/kubernetes/issues/43014#issuecomment-287164444
130+
_, ok := err.(ns.NSPathNotExistErr)
131+
if ok {
132+
return nil
133+
}
134+
return err
135+
}
136+
126137
if err != nil {
127138
return fmt.Errorf("cmdDel failed: %v", err)
128139
}

0 commit comments

Comments
 (0)