From 4369e91b8c22fdb94ce71765187e46655908ab66 Mon Sep 17 00:00:00 2001 From: Codex Date: Fri, 10 Jul 2026 04:14:29 +0200 Subject: [PATCH] fix: accept disabled pac delivery state --- scripts/src/platform-infra-pipelines-as-code-remote.sh | 6 +++++- scripts/src/platform-infra-pipelines-as-code.ts | 5 +++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/scripts/src/platform-infra-pipelines-as-code-remote.sh b/scripts/src/platform-infra-pipelines-as-code-remote.sh index 4b98f2a5..0c52c0ad 100644 --- a/scripts/src/platform-infra-pipelines-as-code-remote.sh +++ b/scripts/src/platform-infra-pipelines-as-code-remote.sh @@ -928,12 +928,15 @@ const healthUrl = process.env.UNIDESK_PAC_DIAG_HEALTH_URL || null; const healthStatus = process.env.UNIDESK_PAC_DIAG_HEALTH_STATUS || null; const healthReady = !healthUrl || healthStatus === '200'; const gitopsReady = Boolean(artifact.gitopsCommit || argo.revision); +const deliveryDisabled = artifact.imageStatus === 'disabled'; let code = 'pac-diagnostics-not-applicable'; let phase = 'not-applicable'; let ok = true; let hint = 'consumer has no sentinel image_repository diagnostic config'; if (process.env.UNIDESK_PAC_DIAG_IMAGE_REPOSITORY) { - if (!sourceCommit) { + if (deliveryDisabled) { + code = 'pac-delivery-disabled'; phase = 'disabled'; hint = 'delivery is disabled by YAML; registry, GitOps and runtime artifacts are intentionally absent'; + } else if (!sourceCommit) { ok = false; code = 'sentinel-pac-source-unknown'; phase = 'source-unknown'; hint = 'latest PaC PipelineRun did not expose a source commit'; } else if (!registryPresent) { ok = false; code = 'sentinel-pac-registry-missing'; phase = 'source-ready-registry-missing'; hint = 'PaC source commit is known but the configured registry tag is missing'; @@ -972,6 +975,7 @@ process.stdout.write(JSON.stringify({ runtime: { image: runtimeImage, digest: runtime.digest || null, readyReplicas: runtime.readyReplicas ?? null, replicas: runtime.replicas ?? null }, health: { url: healthUrl, status: healthStatus, ready: healthReady }, pipelineRun: latest.name || null, + deliveryDisabled, valuesPrinted: false, })); NODE diff --git a/scripts/src/platform-infra-pipelines-as-code.ts b/scripts/src/platform-infra-pipelines-as-code.ts index 3dd6eb93..31e406c5 100644 --- a/scripts/src/platform-infra-pipelines-as-code.ts +++ b/scripts/src/platform-infra-pipelines-as-code.ts @@ -865,10 +865,11 @@ function nodeStatusRow(targetId: string, consumer: PacConsumer, repository: PacR const runtime = record(summary.runtime); const diagnostics = record(summary.diagnostics); const pipelineGate = record(summary.pipelineRunGate); + const deliveryDisabled = stringValue(artifact.imageStatus) === "disabled"; const desired = numericValue(runtime.replicas); const readyReplicas = numericValue(runtime.readyReplicas); - const runtimeReady = desired !== null && desired > 0 && readyReplicas === desired; - const argoReady = stringValue(argo.sync) === "Synced" && stringValue(argo.health) === "Healthy"; + const runtimeReady = deliveryDisabled || (desired !== null && desired > 0 && readyReplicas === desired); + const argoReady = deliveryDisabled || (stringValue(argo.sync) === "Synced" && stringValue(argo.health) === "Healthy"); const ciReady = pipelineGate.ok === true; const diagnosticsReady = diagnostics.ok !== false; const ready = current.ok === true && ciReady && argoReady && runtimeReady && diagnosticsReady;