Skip to content

Commit 2474a99

Browse files
committed
Add IsNotFound case to ListPodSandboxStats
Fixes #10013. It seems we can end up in a spot where the sandbox store still has a listing for a pod, whereas containerds underlying store has removed it. It might be better to shield the caller (k8s) from these transient errors. Signed-off-by: Danny Canter <[email protected]>
1 parent c17839b commit 2474a99

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

internal/cri/server/sandbox_stats_list.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ func (c *criService) ListPodSandboxStats(
3939
for _, sandbox := range sandboxes {
4040
sandboxStats, err := c.podSandboxStats(ctx, sandbox)
4141
switch {
42-
case errdefs.IsUnavailable(err):
42+
case errdefs.IsUnavailable(err), errdefs.IsNotFound(err):
4343
log.G(ctx).WithField("podsandboxid", sandbox.ID).Debugf("failed to get pod sandbox stats, this is likely a transient error: %v", err)
4444
case err != nil:
4545
errs = append(errs, fmt.Errorf("failed to decode sandbox container metrics for sandbox %q: %w", sandbox.ID, err))

0 commit comments

Comments
 (0)