MCPcopy Create free account
hub / github.com/vercel/vercel / selectStorageDriver

Function selectStorageDriver

packages/container/src/storage-driver.ts:57–75  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

55 * to `vfs` to force a working driver if overlay can't initialize on a cell).
56 */
57export 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

Callers 4

ensureReadyFunction · 0.90
logDiagnosticsFunction · 0.90
startDockerDaemonFunction · 0.90
buildahStorageArgsFunction · 0.85

Calls 3

readStringFunction · 0.90
isBuildContainerFunction · 0.90
hasBinaryFunction · 0.70

Tested by

no test coverage detected