Skip to content

Commit b30a797

Browse files
committed
rebase fixups
1 parent 36cbccb commit b30a797

File tree

2 files changed

+20
-14
lines changed

2 files changed

+20
-14
lines changed

packages/wrangler/src/api/startDevWorker/LocalRuntimeController.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -228,18 +228,18 @@ export class LocalRuntimeController extends RuntimeController {
228228
data.config.dev.enableContainers &&
229229
this.#currentContainerBuildId !== data.config.dev.containerBuildId
230230
) {
231-
this.#dockerPath = data.config.dev?.dockerPath ?? getDockerPath();
231+
this.dockerPath = data.config.dev?.dockerPath ?? getDockerPath();
232232
assert(
233233
data.config.dev.containerBuildId,
234234
"Build ID should be set if containers are enabled and defined"
235235
);
236-
const containerDevOptions = await getContainerOptions(
236+
const containerDevOptions = await getContainerDevOptions(
237237
data.config.containers,
238238
data.config.dev.containerBuildId
239239
);
240240

241241
for (const container of containerDevOptions) {
242-
this.#containerImageTagsSeen.add(container.image_tag);
242+
this.containerImageTagsSeen.add(container.image_tag);
243243
}
244244
logger.log(chalk.dim("⎔ Preparing container image(s)..."));
245245
await prepareContainerImagesForDev({
@@ -438,7 +438,7 @@ export class LocalRuntimeController extends RuntimeController {
438438
* with image tag set to well-known dev format.
439439
* Undefined if containers are not enabled or not configured.
440440
*/
441-
export async function getContainerOptions(
441+
export async function getContainerDevOptions(
442442
containersConfig: NonNullable<BundleCompleteEvent["config"]["containers"]>,
443443
containerBuildId: string
444444
) {

packages/wrangler/src/api/startDevWorker/MultiworkerRuntimeController.ts

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { logger } from "../../logger";
99
import { castErrorCause } from "./events";
1010
import {
1111
convertToConfigBundle,
12-
getContainerOptions,
12+
getContainerDevOptions,
1313
LocalRuntimeController,
1414
} from "./LocalRuntimeController";
1515
import { convertCfWorkerInitBindingsToBindings } from "./utils";
@@ -137,21 +137,27 @@ export class MultiworkerRuntimeController extends LocalRuntimeController {
137137
);
138138
}
139139

140-
// Assemble container options and build if necessary
141-
const containerOptions = await getContainerOptions(data.config);
142-
this.dockerPath = data.config.dev?.dockerPath ?? getDockerPath();
143-
// keep track of them so we can clean up later
144-
for (const container of containerOptions ?? []) {
145-
this.containerImageTagsSeen.add(container.imageTag);
146-
}
147140
if (
148-
containerOptions &&
141+
data.config.containers?.length &&
149142
this.#currentContainerBuildId !== data.config.dev.containerBuildId
150143
) {
151144
logger.log(chalk.dim("⎔ Preparing container image(s)..."));
145+
// Assemble container options and build if necessary
146+
assert(
147+
data.config.dev.containerBuildId,
148+
"Build ID should be set if containers are enabled and defined"
149+
);
150+
const containerOptions = await getContainerDevOptions(
151+
data.config.containers,
152+
data.config.dev.containerBuildId
153+
);
154+
this.dockerPath = data.config.dev?.dockerPath ?? getDockerPath();
155+
// keep track of them so we can clean up later
156+
for (const container of containerOptions ?? []) {
157+
this.containerImageTagsSeen.add(container.image_tag);
158+
}
152159
await prepareContainerImagesForDev({
153160
dockerPath: this.dockerPath,
154-
configPath: data.config.config,
155161
containerOptions,
156162
onContainerImagePreparationStart: (buildStartEvent) => {
157163
this.containerBeingBuilt = {

0 commit comments

Comments
 (0)