diff --git a/.gitignore b/.gitignore index e2d6002..f31d6a1 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ node_modules/ npm-debug.log* coverage/ dist/ +test/fixtures/golden/ diff --git a/src/adapters/kubernetes-workload-fragment.ts b/src/adapters/kubernetes-workload-fragment.ts index 1f46f01..952d9fa 100644 --- a/src/adapters/kubernetes-workload-fragment.ts +++ b/src/adapters/kubernetes-workload-fragment.ts @@ -118,6 +118,13 @@ function buildWorkloadManifest(workload: WorkloadV2, ns: string, images: Record< }; } +/** TTL after job completion (Option B decision). Allows Flux to re-apply a + * new Job after the previous one is automatically cleaned up, avoiding + * AlreadyExists conflicts on reconciliation. Value must exceed the Flux + * reconciliation interval + health-check scrape window; 3600 s (1 h) is + * the owner-decided value (DECISIONS.md 2026-07-12). */ +const JOB_TTL_SECONDS_AFTER_FINISHED = 3600; + function buildJobManifest(workload: WorkloadV2, ns: string, images: Record): K8sManifest { const podSpec: Record = { serviceAccountName: workload.name, @@ -135,6 +142,7 @@ function buildJobManifest(workload: WorkloadV2, ns: string, images: Record m.kind === "PersistentVolumeClaim"), "Job workload must not emit PVCs");