Merge pull request #5569 from tnqn/teardown-network-timeout
Fix cleanup context of teardownPodNetwork
This commit is contained in:
commit
7d77b51b49
@ -132,8 +132,10 @@ func (c *criService) RunPodSandbox(ctx context.Context, r *runtime.RunPodSandbox
|
|||||||
sandbox.NetNSPath = sandbox.NetNS.GetPath()
|
sandbox.NetNSPath = sandbox.NetNS.GetPath()
|
||||||
defer func() {
|
defer func() {
|
||||||
if retErr != nil {
|
if retErr != nil {
|
||||||
|
deferCtx, deferCancel := ctrdutil.DeferContext()
|
||||||
|
defer deferCancel()
|
||||||
// Teardown network if an error is returned.
|
// Teardown network if an error is returned.
|
||||||
if err := c.teardownPodNetwork(ctx, sandbox); err != nil {
|
if err := c.teardownPodNetwork(deferCtx, sandbox); err != nil {
|
||||||
log.G(ctx).WithError(err).Errorf("Failed to destroy network for sandbox %q", id)
|
log.G(ctx).WithError(err).Errorf("Failed to destroy network for sandbox %q", id)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user