fix: seed opencode runtime image with git
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user