fix: expose sentinel follower tekton status
This commit is contained in:
@@ -232,6 +232,9 @@ followers:
|
|||||||
gitMirrorNamespace: devops-infra
|
gitMirrorNamespace: devops-infra
|
||||||
gitMirrorDeployment: git-mirror-http
|
gitMirrorDeployment: git-mirror-http
|
||||||
repoPath: /cache/pikasTech/unidesk.git
|
repoPath: /cache/pikasTech/unidesk.git
|
||||||
|
tekton:
|
||||||
|
namespace: devops-infra
|
||||||
|
pipelineRunPrefix: hwlab-web-probe-sentinel-jd01-web-probe-sentinel
|
||||||
argo:
|
argo:
|
||||||
namespace: argocd
|
namespace: argocd
|
||||||
application: hwlab-web-probe-sentinel-jd01
|
application: hwlab-web-probe-sentinel-jd01
|
||||||
|
|||||||
@@ -865,6 +865,39 @@ async function runFollowerDrillDown(registry: BranchFollowerRegistry, options: P
|
|||||||
}
|
}
|
||||||
const follower = registry.followers.find((item) => item.id === options.followerId);
|
const follower = registry.followers.find((item) => item.id === options.followerId);
|
||||||
if (follower === undefined) throw new Error(`unknown follower ${options.followerId}`);
|
if (follower === undefined) throw new Error(`unknown follower ${options.followerId}`);
|
||||||
|
if (!options.controller) {
|
||||||
|
const refresh = runControllerReconcileJob(registry, options, { dryRun: true, wait: true, recordState: true });
|
||||||
|
const k8s = readK8sState(registry, options);
|
||||||
|
const stored = k8s.stateByFollower[follower.id] ?? {};
|
||||||
|
const storedSource = asOptionalRecord(stored.source);
|
||||||
|
const storedTarget = asOptionalRecord(stored.target);
|
||||||
|
const command = asOptionalRecord(stored.command);
|
||||||
|
const native = asOptionalRecord(command?.payload);
|
||||||
|
return {
|
||||||
|
ok: refresh.ok && k8s.ok && Object.keys(stored).length > 0,
|
||||||
|
action: options.action,
|
||||||
|
follower: follower.id,
|
||||||
|
adapter: follower.adapter,
|
||||||
|
statusAuthority: "k8s-native-state-configmap",
|
||||||
|
parsedDownstreamCliOutput: false,
|
||||||
|
summary: {
|
||||||
|
phase: stringOrNull(stored.phase) ?? "Observed",
|
||||||
|
observedSha: stringOrNull(storedSource?.observedSha),
|
||||||
|
targetSha: stringOrNull(storedTarget?.targetSha),
|
||||||
|
pipelineRun: stringOrNull(stored.pipelineRun) ?? stringOrNull(stored.inFlightJob),
|
||||||
|
aligned: null,
|
||||||
|
message: stringOrNull(stored.decision) ?? "no controller state yet",
|
||||||
|
},
|
||||||
|
native,
|
||||||
|
refresh,
|
||||||
|
errors: k8s.errors,
|
||||||
|
next: {
|
||||||
|
status: `bun scripts/cli.ts cicd branch-follower status --follower ${follower.id}`,
|
||||||
|
liveStatus: `bun scripts/cli.ts cicd branch-follower status --follower ${follower.id} --live`,
|
||||||
|
runOnceDryRun: `bun scripts/cli.ts cicd branch-follower run-once --follower ${follower.id} --dry-run`,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
const live = await readAdapterStatus(registry, follower, options);
|
const live = await readAdapterStatus(registry, follower, options);
|
||||||
return {
|
return {
|
||||||
ok: live.ok,
|
ok: live.ok,
|
||||||
|
|||||||
Reference in New Issue
Block a user