fix: accept disabled pac delivery state

This commit is contained in:
Codex
2026-07-10 04:14:29 +02:00
parent 2521596a52
commit 4369e91b8c
2 changed files with 8 additions and 3 deletions
@@ -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
@@ -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;