Skip to content

feat: add job workload support to healthClass schema and fragment pipeline#41

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

feat: add job workload support to healthClass schema and fragment pipeline#41
jorisjonkers-dev-agents[bot] merged 2 commits into
mainfrom
feat/healthclass-job

Conversation

@jorisjonkers-dev-agents

Copy link
Copy Markdown
Contributor

Summary

  • Adds job as a valid healthClass value in cluster-composition-lock and cluster-state schemas
  • Extends WorkloadV2 with a kind field ("deployment" | "statefulset" | "job") to distinguish job workloads
  • Extends kubernetes-workload-fragment to render batch/v1 Job manifests for kind: job workloads, carrying app.kubernetes.io/component=migration label for prune-guardrails compatibility (plan F5)
  • Extends emit-kustomization-health to emit kind: Job healthChecks with wait: false for job workloads (Flux uses Job completion condition, not the Ready condition that never fires for Jobs)
  • Adds job timeout class (10m) to HEALTH_TIMEOUT_CLASS_MAP
  • Adds waitOverride option to emitKustomizationHealth for explicit control
  • Guards against PVC output in the fragment renderer (plan F4)

This is Phase 1 of the stalwart-provisioner fragment-native registration plan. Phase 0 (stalwart-provisioner publish pipeline) and Phase 2 (homelab-deploy compose extension) are in sibling PRs.

Test plan

  • npm run test passes (279 tests, 278 pass, 0 fail, 1 skipped pre-existing)
  • Coverage gates met: lines ≥90, branches ≥80
  • New tests: job fragment renders batch/v1 Job with migration label; emit-kustomization-health produces kind: Job healthCheck with wait: false; PVC guard; wait: true default preserved for non-job workloads

…eline

Add `job` as a valid healthClass in cluster-composition-lock and cluster-state schemas.
Extend `WorkloadV2` with a `kind` field to distinguish job workloads. Extend
`kubernetes-workload-fragment` to render `batch/v1 Job` manifests for job workloads,
carrying `app.kubernetes.io/component=migration` label for prune-guardrails
compatibility. Extend `emit-kustomization-health` to emit `kind: Job` health checks
with `wait: false` for job workloads (Flux uses Job completion condition, not Ready).
Add `job` timeout class (10m) to HEALTH_TIMEOUT_CLASS_MAP. Guard against PVC output
in the fragment renderer. Add `waitOverride` to `emitKustomizationHealth` options.

Tests: job fragment renders batch/v1 Job with migration label; emit-kustomization-health
produces kind:Job healthCheck with wait:false; PVC guard; wait:true default preserved.
…FLICT validation

- Remove dead PVC pre-output guard that referenced non-existent WorkloadV2.storage field (F1)
- Change hasJobWorkload (some) to allJobWorkloads (every) so wait:false is only emitted
  when every workload in the deployment is job-kind; mixed deployments keep wait:true (F2)
- Add E_JOB_STATEFUL_CONFLICT check to validateDeploymentSemantics; kind:job + stateful:true
  is mutually exclusive
- Add 6 tests covering job fragment rendering, kustomization-health emission, wait override,
  mixed-deployment wait:true guard, and the new conflict validation
- Fix conflict test to call validateDeploymentSemantics directly (inputWith() patches after
  loadFragmentInputFromPaths so the validator never saw the patched workload)
@jorisjonkers-dev-agents jorisjonkers-dev-agents Bot merged commit 86a757d 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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant