fix: unify node git mirror apply path
This commit is contained in:
@@ -343,6 +343,29 @@ export function nodeRuntimeApply(scoped: ReturnType<typeof parseNodeScopedDelega
|
||||
degradedReason: "node-runtime-base-image-seed-failed",
|
||||
};
|
||||
}
|
||||
const infra = runHwlabNodeControlPlaneInfra([
|
||||
"apply",
|
||||
"--node", scoped.node,
|
||||
"--lane", scoped.lane,
|
||||
scoped.dryRun ? "--dry-run" : "--confirm",
|
||||
"--timeout-seconds", String(scoped.timeoutSeconds),
|
||||
]);
|
||||
if (!infraResultOk(infra)) {
|
||||
return {
|
||||
ok: false,
|
||||
command: `hwlab nodes control-plane apply --node ${scoped.node} --lane ${scoped.lane}`,
|
||||
node: scoped.node,
|
||||
lane: scoped.lane,
|
||||
mode: scoped.dryRun ? "dry-run" : "confirmed-apply",
|
||||
phase: "control-plane-infra-apply",
|
||||
sourceCommit,
|
||||
localPostgres,
|
||||
secrets,
|
||||
baseImage,
|
||||
infra,
|
||||
degradedReason: "node-runtime-control-plane-infra-apply-failed",
|
||||
};
|
||||
}
|
||||
const render = renderNodeRuntimeControlPlane(spec, sourceCommit, scoped.timeoutSeconds);
|
||||
if (!isCommandSuccess(render.result)) {
|
||||
return {
|
||||
@@ -356,6 +379,7 @@ export function nodeRuntimeApply(scoped: ReturnType<typeof parseNodeScopedDelega
|
||||
localPostgres,
|
||||
secrets,
|
||||
baseImage,
|
||||
infra,
|
||||
renderDir: render.renderDir,
|
||||
renderLocation: render.location,
|
||||
render: compactRuntimeCommand(render.result),
|
||||
@@ -381,6 +405,7 @@ export function nodeRuntimeApply(scoped: ReturnType<typeof parseNodeScopedDelega
|
||||
localPostgres,
|
||||
secrets,
|
||||
baseImage,
|
||||
infra,
|
||||
renderDir: render.renderDir,
|
||||
renderLocation: render.location,
|
||||
render: compactRuntimeCommand(render.result),
|
||||
@@ -397,6 +422,10 @@ export function nodeRuntimeApply(scoped: ReturnType<typeof parseNodeScopedDelega
|
||||
};
|
||||
}
|
||||
|
||||
function infraResultOk(value: Record<string, unknown> | RenderedCliResult): boolean {
|
||||
return value.ok !== false;
|
||||
}
|
||||
|
||||
export function nodeRuntimeRefresh(scoped: ReturnType<typeof parseNodeScopedDelegatedOptions>): Record<string, unknown> {
|
||||
const spec = scoped.spec;
|
||||
const script = [
|
||||
|
||||
@@ -176,7 +176,6 @@ export function httpProxyEndpoint(value: string): { host: string; port: number }
|
||||
|
||||
export function nodeRuntimeControlPlaneFiles(spec: HwlabRuntimeLaneSpec, renderDir: string): string[] {
|
||||
return [
|
||||
`${renderDir}/devops-infra/git-mirror.yaml`,
|
||||
`${renderDir}/${spec.runtimeRenderDir}/namespace.yaml`,
|
||||
`${renderDir}/${spec.tektonDir}/rbac.yaml`,
|
||||
`${renderDir}/${spec.tektonDir}/pipeline.yaml`,
|
||||
|
||||
Reference in New Issue
Block a user