Skip to content

Commit 29596fd

Browse files
committed
fix(cli): match buildx builder network option anywhere on the driver options line
The inspect output sorts driver options, so any additional option (e.g. image=) lands before network= and the anchored match failed, causing the builder to be deleted and recreated on every deploy.
1 parent c55613d commit 29596fd

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

packages/cli-v3/src/deploy/buildImage.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,9 @@ async function localBuildImage(options: SelfHostedBuildImageOptions): Promise<Bu
396396
for await (const line of inspectProcess) {
397397
inspectLogs.push(line);
398398

399-
if (line.match(/Driver Options:\s+network="([^"]+)"/)?.at(1) === options.network) {
399+
// The driver options line may carry more opts than network (sorted, e.g. image=
400+
// before network=), so match network= anywhere on it.
401+
if (line.match(/Driver Options:.*\bnetwork="([^"]+)"/)?.at(1) === options.network) {
400402
hasCorrectNetwork = true;
401403
}
402404
}

0 commit comments

Comments
 (0)