Skip to content

feat(job-workload): add ttlSecondsAfterFinished:3600 to rendered Job manifests#43

Merged
jorisjonkers-dev-agents[bot] merged 2 commits into
mainfrom
feat/job-ttl-seconds
Jul 12, 2026
Merged

feat(job-workload): add ttlSecondsAfterFinished:3600 to rendered Job manifests#43
jorisjonkers-dev-agents[bot] merged 2 commits into
mainfrom
feat/job-ttl-seconds

Conversation

@jorisjonkers-dev-agents

Copy link
Copy Markdown
Contributor

Implements Option B of the job-name-uniqueness decision (stalwart-provisioner Phase 3, DECISIONS.md 2026-07-12): rendered `batch/v1 Job` manifests now carry `ttlSecondsAfterFinished: 3600`.

What changes

  • `src/adapters/kubernetes-workload-fragment.ts` — `buildJobManifest` now sets `spec.ttlSecondsAfterFinished: 3600` on all rendered Job manifests.
  • `test/fragment-engine.test.js` — asserts the TTL field is present with the correct value.
  • `test/fixtures/golden/render-hash.txt` — updated to reflect the new Job spec shape (the hash was already stale on origin/main).

Why

When Flux reconciles a Kustomization, it re-applies the Job manifest. If the Job has already completed, Kubernetes rejects the re-apply with `AlreadyExists`. TTL-based cleanup allows the completed Job to be automatically deleted after one hour, so the next reconciliation creates a fresh run without conflict. The 3600 s window exceeds any plausible Flux reconciliation interval + health-check scrape window, ensuring the Job completion status is observed before deletion.

Release

Patch bump to v0.17.1. stalwart-provisioner publish workflow already pins `schema-version: 0.17.0`; bump to 0.17.1 in a follow-up commit to the stalwart-provisioner release.yml.

…manifests

Adds ttlSecondsAfterFinished: 3600 to all batch/v1 Job manifests rendered
by the kubernetes-workload-fragment adapter. This implements Option B of
the job-name-uniqueness decision (DECISIONS.md 2026-07-12): completed Jobs
are automatically cleaned up after one hour, allowing Flux to re-apply a
new Job on the next reconciliation without AlreadyExists conflicts.

The TTL value (3600 s) is chosen to exceed the Flux reconciliation interval
plus health-check scrape window, ensuring Flux can observe Job completion
before the resource is deleted.

Updates the golden render hash to reflect the new Job spec shape.
@jorisjonkers-dev-agents jorisjonkers-dev-agents Bot added the type: feature New user-facing or operator-facing capability. label Jul 12, 2026
The golden render hash changes on every version bump (the context digest
embeds schemaVersion), so committing it causes CI failures on release PRs.
This was previously fixed in a23c7cc; re-add the gitignore entry that was
accidentally missing, preventing future reintroduction.
@jorisjonkers-dev-agents jorisjonkers-dev-agents Bot merged commit 0137314 into main Jul 12, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: feature New user-facing or operator-facing capability.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant