Skip to content

Commit f183527

Browse files
MikeZappa87k8s-infra-cherrypick-robot
authored andcommitted
fix issue where cni del is never executed
Signed-off-by: Michael Zappa <[email protected]>
1 parent 3661d86 commit f183527

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

internal/cri/server/sandbox_stop.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,9 @@ func (c *criService) stopPodSandbox(ctx context.Context, sandbox sandboxstore.Sa
118118
if err := c.teardownPodNetwork(ctx, sandbox); err != nil {
119119
return fmt.Errorf("failed to destroy network for sandbox %q: %w", id, err)
120120
}
121+
} else {
122+
log.G(ctx).Warnf("CNI result is not found for sandbox %q, attempting teardown anyway, ignoring errors", id)
123+
_ = c.teardownPodNetwork(ctx, sandbox)
121124
}
122125
if err := sandbox.NetNS.Remove(); err != nil {
123126
return fmt.Errorf("failed to remove network namespace for sandbox %q: %w", id, err)

0 commit comments

Comments
 (0)