Merge pull request #9270 from fuweid/fix-sb-issues
pkg/cri: should ignore no sandbox bucket
This commit is contained in:
commit
18c9e7ec4c
@ -239,6 +239,9 @@ func (s *sandboxStore) Delete(ctx context.Context, id string) error {
|
||||
}
|
||||
|
||||
if err := buckets.DeleteBucket([]byte(id)); err != nil {
|
||||
if err == bbolt.ErrBucketNotFound {
|
||||
err = errdefs.ErrNotFound
|
||||
}
|
||||
return fmt.Errorf("failed to delete sandbox %q: %w", id, err)
|
||||
}
|
||||
|
||||
|
@ -105,8 +105,11 @@ func (c *criService) RemovePodSandbox(ctx context.Context, r *runtime.RemovePodS
|
||||
c.sandboxStore.Delete(id)
|
||||
|
||||
if err := c.client.SandboxStore().Delete(ctx, id); err != nil {
|
||||
if !errdefs.IsNotFound(err) {
|
||||
return nil, fmt.Errorf("failed to remove sandbox metadata from store: %w", err)
|
||||
}
|
||||
log.G(ctx).WithError(err).Warnf("failed to delete sandbox metadata from store: %q maybe recovered from v1.x release", id)
|
||||
}
|
||||
|
||||
// Release the sandbox name reserved for the sandbox.
|
||||
c.sandboxNameIndex.ReleaseByKey(id)
|
||||
|
Loading…
Reference in New Issue
Block a user