fix: harden M3 simulator identities and wiring

This commit is contained in:
Code Queue Review
2026-05-23 04:30:01 +00:00
parent 82b1f9491e
commit c095d4d943
14 changed files with 416 additions and 18 deletions
+24 -2
View File
@@ -419,6 +419,21 @@ async function collectReadOnlySupplementalEvidence() {
const patchPanelEndpointMap = patchPanel?.env.HWLAB_PATCH_PANEL_ENDPOINT_MAP
? JSON.parse(patchPanel.env.HWLAB_PATCH_PANEL_ENDPOINT_MAP)
: {};
const patchPanelWiringConfig = patchPanel?.env.HWLAB_PATCH_PANEL_WIRING_CONFIG
? JSON.parse(patchPanel.env.HWLAB_PATCH_PANEL_WIRING_CONFIG)
: null;
const patchPanelHasManifestRoute =
patchPanelWiringConfig?.status === "active" &&
patchPanelWiringConfig?.constraints?.propagation === "patch-panel-only" &&
patchPanelWiringConfig?.constraints?.localLoopbackSubstituteAllowed === false &&
(patchPanelWiringConfig?.connections ?? []).some(
(connection) =>
connection.from?.resourceId === requiredM3Connection.fromResourceId &&
connection.from?.port === requiredM3Connection.fromPort &&
connection.to?.resourceId === requiredM3Connection.toResourceId &&
connection.to?.port === requiredM3Connection.toPort &&
connection.mode === "exclusive"
);
const boxReadyForM3 =
box?.kind === "StatefulSet" &&
box?.replicas === 2 &&
@@ -436,7 +451,13 @@ async function collectReadOnlySupplementalEvidence() {
]);
const patchPanelReadyForM3 =
patchPanel?.replicas === 1 &&
patchPanelEndpointMap.res_boxsimu_2 === "http://hwlab-box-simu-2.hwlab-dev.svc.cluster.local:7201";
patchPanel?.m3Route?.fromResourceId === requiredM3Connection.fromResourceId &&
patchPanel?.m3Route?.fromPort === requiredM3Connection.fromPort &&
patchPanel?.m3Route?.patchPanelServiceId === "hwlab-patch-panel" &&
patchPanel?.m3Route?.toResourceId === requiredM3Connection.toResourceId &&
patchPanel?.m3Route?.toPort === requiredM3Connection.toPort &&
patchPanelEndpointMap.res_boxsimu_2 === "http://hwlab-box-simu-2.hwlab-dev.svc.cluster.local:7201" &&
patchPanelHasManifestRoute;
const manifestReadyForM3 = boxReadyForM3 && gatewayReadyForM3 && patchPanelReadyForM3 && hasInstanceServices;
return [
@@ -466,7 +487,8 @@ async function collectReadOnlySupplementalEvidence() {
},
"hwlab-patch-panel": {
replicas: patchPanel?.replicas ?? null,
env: patchPanel?.env ?? null
env: patchPanel?.env ?? null,
firstClassWiringConfig: patchPanelWiringConfig
},
instanceServices: [...serviceMap.keys()].filter((name) =>
name.startsWith("hwlab-box-simu-") || name.startsWith("hwlab-gateway-simu-")