Skip to content

Commit

Permalink
Merge pull request containerd#10778 from matteopulcini6/release1.6
Browse files Browse the repository at this point in the history
[release/1.6] Handle teardown failure to avoid blocking cleanup
  • Loading branch information
kzys authored Oct 18, 2024
2 parents 11aea72 + b1f8b03 commit 8a30dc0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/cri/server/sandbox_run.go
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,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
}
}
}
}()
Expand Down

0 comments on commit 8a30dc0

Please sign in to comment.