Merge pull request #1651 from pikasTech/fix/unidesk-host-gitops-lane
Pipelines as Code CI / hwlab-web-probe-sentinel-nc01- Success
Pipelines as Code CI / unidesk-host- Success

fix: 从 YAML 选择 GitOps mirror lane
This commit is contained in:
Lyon
2026-07-10 11:19:48 +08:00
committed by GitHub
2 changed files with 5 additions and 1 deletions
@@ -121,6 +121,7 @@ consumers:
argoNamespace: argocd
argoApplication: unidesk-host
closeoutGitOpsMirrorFlush: true
closeoutGitOpsMirrorLane: v03
argoBootstrap:
project: default
repoUrl: http://git-mirror-http.devops-infra.svc.cluster.local:8080/pikasTech/unidesk.git
@@ -130,6 +130,7 @@ interface PacConsumer {
} | null;
repositoryRef: string;
closeoutGitOpsMirrorFlush: boolean;
closeoutGitOpsMirrorLane: "v02" | "v03" | null;
}
interface CommonOptions {
@@ -343,6 +344,7 @@ function parseConsumer(consumer: Record<string, unknown>, path: string, defaultR
},
repositoryRef: typeof consumer.repositoryRef === "string" && consumer.repositoryRef.length > 0 ? consumer.repositoryRef : defaultRepositoryRef,
closeoutGitOpsMirrorFlush: consumer.closeoutGitOpsMirrorFlush === undefined ? false : y.booleanField(consumer, "closeoutGitOpsMirrorFlush", path),
closeoutGitOpsMirrorLane: consumer.closeoutGitOpsMirrorLane === undefined ? null : y.enumField(consumer, "closeoutGitOpsMirrorLane", path, ["v02", "v03"] as const),
};
}
@@ -1530,12 +1532,13 @@ async function runCloseoutGitOpsMirrorFlush(config: UniDeskConfig, pac: PacConfi
};
}
const deadlineMs = Date.now() + (cfg.waitTimeoutSeconds * 1000);
const gitOpsMirrorLane = consumer.closeoutGitOpsMirrorLane ?? consumer.lane;
const scoped = parseNodeScopedDelegatedOptions("git-mirror", [
"flush",
"--node",
consumer.node,
"--lane",
consumer.lane,
gitOpsMirrorLane,
"--confirm",
"--wait",
"--timeout-seconds",