Handle teardown failure to avoid blocking cleanup
Signed-off-by: Matteo Pulcini <Matteo.Pulcini@ibm.com>
This commit is contained in:
parent
5d49f2e3ae
commit
0742238cd6
@ -220,6 +220,11 @@ func (c *criService) RunPodSandbox(ctx context.Context, r *runtime.RunPodSandbox
|
||||
// Teardown network if an error is returned.
|
||||
if cleanupErr = c.teardownPodNetwork(deferCtx, sandbox); cleanupErr != nil {
|
||||
log.G(ctx).WithError(cleanupErr).Errorf("Failed to destroy network for sandbox %q", id)
|
||||
|
||||
// ignoring failed to destroy networks when we failed to setup networks
|
||||
if sandbox.CNIResult == nil {
|
||||
cleanupErr = nil
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user