fix: seed opencode runtime image with git

This commit is contained in:
Codex
2026-06-30 13:11:56 +00:00
parent b92ceffda9
commit 94165a3d6a
3 changed files with 90 additions and 15 deletions
+16 -6
View File
@@ -313,12 +313,13 @@ export interface HwlabRuntimeImageRewriteSpec {
export interface HwlabRuntimeImageBuildSpec {
readonly id: string;
readonly kind: "moonbridge";
readonly kind: "moonbridge" | "opencode-git";
readonly target: string;
readonly sourceRepo: string;
readonly sourceRef: string;
readonly builderImage: string;
readonly goProxy: string;
readonly sourceImage?: string;
readonly sourceRepo?: string;
readonly sourceRef?: string;
readonly builderImage?: string;
readonly goProxy?: string;
readonly dockerNetworkMode: "default" | "host";
}
@@ -1569,7 +1570,16 @@ function runtimeImageBuildsConfig(value: unknown, path: string): HwlabRuntimeIma
const itemPath = `${path}[${index}]`;
const raw = asRecord(item, itemPath);
const kind = stringField(raw, "kind", itemPath);
if (kind !== "moonbridge") throw new Error(`${itemPath}.kind must be moonbridge`);
if (kind !== "moonbridge" && kind !== "opencode-git") throw new Error(`${itemPath}.kind must be moonbridge or opencode-git`);
if (kind === "opencode-git") {
return {
id: stringField(raw, "id", itemPath),
kind,
target: stringField(raw, "target", itemPath),
sourceImage: stringField(raw, "sourceImage", itemPath),
dockerNetworkMode: enumStringField(raw, "dockerNetworkMode", itemPath, ["default", "host"]),
};
}
return {
id: stringField(raw, "id", itemPath),
kind,