()
| 55 | * to `vfs` to force a working driver if overlay can't initialize on a cell). |
| 56 | */ |
| 57 | export function selectStorageDriver(): Promise<string | undefined> { |
| 58 | if (!cachedStorageDriver) { |
| 59 | cachedStorageDriver = (async () => { |
| 60 | const override = readString(process.env.VERCEL_VCR_DOCKER_STORAGE_DRIVER); |
| 61 | if (override) { |
| 62 | return override; |
| 63 | } |
| 64 | if (isBuildContainer()) { |
| 65 | // Defer to /etc/containers/storage.conf (native overlay on /vercel). |
| 66 | return undefined; |
| 67 | } |
| 68 | if ((await hasBinary('fuse-overlayfs')) && existsSync('/dev/fuse')) { |
| 69 | return 'fuse-overlayfs'; |
| 70 | } |
| 71 | return 'vfs'; |
| 72 | })(); |
| 73 | } |
| 74 | return cachedStorageDriver; |
| 75 | } |
| 76 | |
| 77 | /** |
| 78 | * AL2023 SPAL buildah defaults to `short-name-mode = enforcing`, which fails in |
no test coverage detected