containerd/metadata
Wei Fu 337cc21719 pkg/cri: should ignore no sandbox bucket
The sandbox might be recovered from v1.x release. It doesn't have
metadata bucket. We should ignore the not-found error.

How to reproduce the issue:

```bash
➜  containerd git:(main) sudo ctr version
Client:
  Version:  1.6.22
  Revision: 8165feabfdfe38c65b599c4993d227328c231fca
  Go version: go1.19.11

Server:
  Version:  1.6.22
  Revision: 8165feabfdfe38c65b599c4993d227328c231fca
  UUID: be4216aa-8a2e-4305-9186-efeacd2d9a17

➜  containerd git:(main) cat /tmp/pod.json
{
    "metadata": {
        "name": "nginx-sandbox",
        "namespace": "default",
        "attempt": 1,
        "uid": "hdishd83djaidwnduwk28bcsb"
    },
    "log_directory": "/tmp",
    "linux": {
    }
}

➜  containerd git:(main) sudo crictl runp /tmp/pod.json
616ea1cc657c57e80abf74e707a8177878ac2ec1ab7c346b4adb7bc0fadf986e
➜  containerd git:(main) sudo crictl pods
POD ID              CREATED             STATE               NAME                NAMESPACE           ATTEMPT             RUNTIME
616ea1cc657c5       9 seconds ago       Ready               nginx-sandbox       default             1                   (default)

➜  containerd git:(main) make BUILDTAGS=no_btrfs
➜  containerd git:(main) sudo PREFIX=/usr make install
+ install bin/ctr bin/containerd bin/containerd-stress bin/containerd-shim-runc-v2

➜  containerd git:(main) sudo systemctl restart containerd
➜  containerd git:(main) sudo ctr version
Client:
  Version:  v1.7.0-943-g980767551
  Revision: 9807675518
  Go version: go1.20.10

Server:
  Version:  v1.7.0-943-g980767551
  Revision: 9807675518
  UUID: be4216aa-8a2e-4305-9186-efeacd2d9a17

➜  containerd git:(main) sudo crictl stopp  616ea1cc657c5
Stopped sandbox 616ea1cc657c5

➜  containerd git:(main) sudo crictl rmp 616ea1cc657c5
E1019 14:03:37.885162 2052643 remote_runtime.go:295] "RemovePodSandbox from runtime service failed" err="rpc error: code = Unknown desc = failed to remove sandbox metadata from store: failed to delete sandbox \"616ea1cc657c57e80abf74e707a8177878ac2ec1ab7c346b4adb7bc0fadf986e\": bucket not found" podSandboxID="616ea1cc657c5"
removing the pod sandbox "616ea1cc657c5": rpc error: code = Unknown desc = failed to remove sandbox metadata from store: failed to delete sandbox "616ea1cc657c57e80abf74e707a8177878ac2ec1ab7c346b4adb7bc0fadf986e": bucket not found
```

Signed-off-by: Wei Fu <fuweid89@gmail.com>
2023-10-20 15:20:18 +08:00
..
boltutil go.mod: github.com/containerd/typeurl/v2 v2.1.0 2023-02-11 23:39:52 +09:00
plugin Generalize the plugin package 2023-10-12 21:22:32 -07:00
adaptors.go [sandbox] Implement metadata store 2022-04-08 13:33:47 -07:00
bolt.go feat: replace github.com/pkg/errors to errors 2022-01-07 10:27:03 +08:00
buckets.go sandbox: add Sandboxer field to sandbox metadata 2023-10-16 20:49:36 +08:00
compare_test.go go.mod: github.com/containerd/typeurl/v2 v2.1.0 2023-02-11 23:39:52 +09:00
containers_test.go Fix linter issues for golangci-lint 1.54.2 2023-10-03 21:56:47 +09:00
containers.go avoid "any" as variable name 2023-06-10 13:49:06 +02:00
content_test.go Cleanup metadata tests 2022-06-27 14:42:22 -07:00
content.go Move to use github.com/containerd/log 2023-09-22 07:53:23 -07:00
db_test.go Move to use github.com/containerd/log 2023-09-22 07:53:23 -07:00
db.go Move to use github.com/containerd/log 2023-09-22 07:53:23 -07:00
gc_test.go gc: add support for image expiration 2023-08-31 15:10:13 -07:00
gc.go Move to use github.com/containerd/log 2023-09-22 07:53:23 -07:00
images_test.go Merge pull request #8989 from dmcgowan/add-image-delete-target 2023-10-05 10:53:57 -07:00
images.go Add delete target to image remove 2023-09-19 17:23:33 -07:00
leases_test.go gc: add support for image expiration 2023-08-31 15:10:13 -07:00
leases.go gc: add support for image expiration 2023-08-31 15:10:13 -07:00
migrations.go Adds a no-op migration for metadata v3 2018-09-12 15:33:42 -07:00
namespaces_test.go Cleanup metadata tests 2022-06-27 14:42:22 -07:00
namespaces.go feat: replace github.com/pkg/errors to errors 2022-01-07 10:27:03 +08:00
sandbox_test.go sandbox: add Sandboxer field to sandbox metadata 2023-10-16 20:49:36 +08:00
sandbox.go pkg/cri: should ignore no sandbox bucket 2023-10-20 15:20:18 +08:00
snapshot_test.go Cleanup metadata tests 2022-06-27 14:42:22 -07:00
snapshot.go Move to use github.com/containerd/log 2023-09-22 07:53:23 -07:00