Skip to content

Commit ae097b2

Browse files
committed
Don't set both configuration.image and image
Previously we did this to accommodate cloudchamber apply, but now we just make this change in the apply function. Otherwise the generated config will have both fields set which will error when we re-read it.
1 parent c44405e commit ae097b2

File tree

4 files changed

+2
-7
lines changed

4 files changed

+2
-7
lines changed

packages/wrangler/src/__tests__/cloudchamber/apply.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { writeFileSync } from "node:fs";
21
import {
32
getCloudflareContainerRegistry,
43
SchedulingPolicy,

packages/wrangler/src/__tests__/config/configuration.test.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2408,12 +2408,8 @@ describe("normalizeAndValidateConfig()", () => {
24082408
expect(diagnostics.hasErrors()).toBe(false);
24092409
expect(config.containers).toEqual([
24102410
{
2411-
configuration: {
2412-
image: "docker.io/something:hello",
2413-
},
24142411
class_name: "test-class",
24152412
name: "test-worker-name-test-class",
2416-
// this has been set twice to accomodate both cloudchamber and containers
24172413
image: "docker.io/something:hello",
24182414
image_build_context: undefined,
24192415
},

packages/wrangler/src/cloudchamber/apply.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,8 @@ export async function apply(
333333
log(dim("Container application changes\n"));
334334

335335
for (const appConfigNoDefaults of config.containers) {
336+
appConfigNoDefaults.configuration ??= {};
337+
appConfigNoDefaults.configuration.image = appConfigNoDefaults.image;
336338
const application =
337339
applicationByNames[
338340
appConfigNoDefaults.name ??

packages/wrangler/src/config/validation.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2486,8 +2486,6 @@ function validateContainerApp(
24862486
}
24872487
containerAppOptional.image = resolvedImage;
24882488
containerAppOptional.image_build_context = resolvedBuildContextPath;
2489-
containerAppOptional.configuration ??= {};
2490-
containerAppOptional.configuration.image = resolvedImage;
24912489

24922490
// Validate rollout related configs
24932491
if (

0 commit comments

Comments
 (0)