Skip to content

Commit e2e6171

Browse files
authored
Merge pull request #73 from infosiftr/bbolt-err
Return "bbolt" errors consistently
2 parents d88bd1b + 9285956 commit e2e6171

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

cmd/bashbrew/containerd.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import (
1717
func newBuiltinContainerdServices(ctx context.Context) (containerd.ClientOpt, error) {
1818
// thanks to https://github.com/Azure/image-rootfs-scanner/blob/e7041e47d1a13e15d73d9c85644542e6758f9f3a/containerd.go#L42-L87 for inspiring this magic
1919

20-
root := filepath.Join(defaultCache, "containerd")
20+
root := filepath.Join(defaultCache, "containerd", arch) // because our bbolt is so highly contested, we'll use a containerd directory per-arch 😭
2121
dbPath := filepath.Join(root, "metadata.db")
2222
contentRoot := filepath.Join(root, "content")
2323

@@ -29,6 +29,9 @@ func newBuiltinContainerdServices(ctx context.Context) (containerd.ClientOpt, er
2929
db, err := bbolt.Open(dbPath, 0600, &bbolt.Options{
3030
Timeout: 1 * time.Minute,
3131
})
32+
if err != nil {
33+
return nil, err
34+
}
3235

3336
mdb := metadata.NewDB(db, cs, nil)
3437
return containerd.WithServices(

0 commit comments

Comments
 (0)