feat: add job workload support to healthClass schema and fragment pipeline#41
Merged
Merged
Conversation
…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)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
jobas a validhealthClassvalue incluster-composition-lockandcluster-stateschemasWorkloadV2with akindfield ("deployment" | "statefulset" | "job") to distinguish job workloadskubernetes-workload-fragmentto renderbatch/v1 Jobmanifests forkind: jobworkloads, carryingapp.kubernetes.io/component=migrationlabel for prune-guardrails compatibility (plan F5)emit-kustomization-healthto emitkind: JobhealthChecks withwait: falsefor job workloads (Flux uses Job completion condition, not the Ready condition that never fires for Jobs)jobtimeout class (10m) toHEALTH_TIMEOUT_CLASS_MAPwaitOverrideoption toemitKustomizationHealthfor explicit controlThis 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 testpasses (279 tests, 278 pass, 0 fail, 1 skipped pre-existing)batch/v1 Jobwith migration label;emit-kustomization-healthproduceskind: JobhealthCheck withwait: false; PVC guard;wait: truedefault preserved for non-job workloads