Skip to content

Commit b58e2a3

Browse files
committed
fix(deploy): upload Worker Loader bindings when secrets are pinned
The pinned-secret uploader converts every binding itself, and bindingsFromOutput had no case for the `worker-loader` binding that cf emits for `worker_loaders`. Any app with a Worker Loader binding and a secret failed with "Cloudflare binding LOADER cannot be uploaded with pinned secrets." Map it to the `worker_loader` binding type and cover it in the pinned upload test.
1 parent 4d51362 commit b58e2a3

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

‎packages/void/src/cli/cf-version-api.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,9 @@ function bindingsFromOutput(
283283
case 'version-metadata':
284284
bindings.push({ name, type: 'version_metadata' });
285285
break;
286+
case 'worker-loader':
287+
bindings.push({ name, type: 'worker_loader' });
288+
break;
286289
default:
287290
throw new Error(`Cloudflare binding ${name} cannot be uploaded with pinned secrets.`);
288291
}

‎packages/void/test/unit/cf-version-runner.test.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1111,6 +1111,7 @@ async function verifyPinnedUpload(atomic: boolean): Promise<void> {
11111111
vectorize: [{ binding: 'VECTORS', index_name: 'vectors' }],
11121112
browser: { binding: 'BROWSER' },
11131113
images: { binding: 'IMAGES' },
1114+
worker_loaders: [{ binding: 'LOADER' }],
11141115
dispatch_namespaces: [
11151116
{
11161117
binding: 'DISPATCH',
@@ -1287,6 +1288,7 @@ async function verifyPinnedUpload(atomic: boolean): Promise<void> {
12871288
{ name: 'VECTORS', type: 'vectorize', index_name: 'vectors' },
12881289
{ name: 'BROWSER', type: 'browser' },
12891290
{ name: 'IMAGES', type: 'images' },
1291+
{ name: 'LOADER', type: 'worker_loader' },
12901292
{
12911293
name: 'DISPATCH',
12921294
type: 'dispatch_namespace',

0 commit comments

Comments
 (0)