This repository was archived by the owner on Jul 6, 2026. It is now read-only.
Description ⚠️ TDD MANDATORY
Tests MUST be written BEFORE implementation code. No exceptions.
All Job lifecycle scenarios, failure modes, and state transitions must have tests written FIRST.
Description
Implement NixosConfigurationReconciler that manages NixOS configuration application via Kubernetes Jobs.
Tasks
Test First: Job Lifecycle
Test: Job succeeded → Applied=True, Ready=True, Machine updated
Test: Job failed (nix build error) → Stalled=True, reason=ApplyFailed
Test: Job failed (git clone error) → Stalled=True, reason=GitCloneFailed
Test: Job failed (SSH lost) → Stalled=True, reason=SSHFailed
Test: Job timeout → Stalled=True, reason=DeadlineExceeded
Test: Job pending (insufficient resources) → Stalled=True after 5min
Test: Job pending (ImagePullBackOff) → Stalled=True, message contains error
Test: Job pending (secret not found) → Stalled=True, message contains error
Test: Job has correct owner reference
Test: Config deletion cancels running job
Test: Config deletion applies onRemoveFlake (max 3 retries)
Test: Config deletion clears Machine status
Test: Machine not ready → Ready=False, reason=MachineNotReady, requeue
Test First: Concurrency Protection
Core Reconciler
Job Management
Machine Integration
Git Operations
Apply Operations
State Machine
Pending --> Reconciling --> Applied
| |
v |
Stalled <----------+
|
v (delete)
Deleting --> ApplyingRemoval --> Deleted
|
v (3 failures)
Finalizing
Concurrency Model
Per-machine protection : Check hasActiveJobForMachine() before creating new job
Global limit : Check countActiveJobs() against MaxConcurrentJobs
Job labels : Include nio.homystack.com/machine for filtering
Reference
See docs/kubebuilder-migration-analysis.md sections 4, 15-16, 22, 24, 26.
Reactions are currently unavailable
Tests MUST be written BEFORE implementation code. No exceptions.
All Job lifecycle scenarios, failure modes, and state transitions must have tests written FIRST.
Description
Implement NixosConfigurationReconciler that manages NixOS configuration application via Kubernetes Jobs.
Tasks
Test First: Job Lifecycle
Test First: Concurrency Protection
Core Reconciler
Job Management
nio.homystack.com/machinelabel to Jobs for per-machine filteringMachine Integration
Git Operations
Apply Operations
State Machine
Concurrency Model
hasActiveJobForMachine()before creating new jobcountActiveJobs()againstMaxConcurrentJobsnio.homystack.com/machinefor filteringReference
See
docs/kubebuilder-migration-analysis.mdsections 4, 15-16, 22, 24, 26.