wso2 / wso2/open-cloud-datacenter
[Feature] Extend Baked Image & Repave (M1) to the bounded Step/Runner controller
@tgcjananga is already working on this.
Since Aug 28, 2026.
- Dominant language
- HCL
- Stars
- 19
- Forks
- 15
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 4
Description
Problem
M1 (#223) shipped a working baked-image + repave implementation, but it lived entirely inside the old monolithic dbinstance_controller.go. PR #241, merged the same day, restructured the controller into bounded per-step internal/ensure/*.go files under a Step/Runner chain and removed spec.osImage/AppliedSpec.OSImage — the field the M1 catalog was keyed off. None of M1's controller-side wiring survived: no repave step, no drift conditions/annotation, no catalog in the new tree. Three files in internal/ensure/ still reference the removed field as dead code.
Solution overview
Extend M1's design onto the current Step/Runner architecture — same mechanism (pre-built Harvester images via Packer, cloud-init activates one PostgreSQL version, repave swaps the OS disk in place with pgdata untouched), same "tenant sets engineVersion only, OS stream is an ops-controlled platform default" split from the original RFC. Full design doc and decision log: my-docs/Baked-Image-newCRD/P003-final-plan.md.
Notable deltas from M1 (see linked #168 update for the full list and rationale): merged ConditionImageDrift (was two condition types); catalog moved to internal/catalog; OS/data disk PVC names carry an 8-hex-char UID slice to prevent leaked-disk reattachment on recreate; images bake every supported PG major version side by side and engineVersion now actually drives which one boots.
Completion checklist
- Config, catalog, RBAC, and CRD/condition surface —
databaseDefaults.osVersion,internal/catalog(BakedImages/LatestBakedImages), PVC RBAC,ConditionImageDrift/ConditionRepaveInProgress+ print columns - Harvester client support —
SwapVMOSDisk/DeletePVConClientInterface/TypedClient/StubHarvester - Controller wiring —
preflight/vmresolve against the catalog, deadOSImagerefs removed,internal/ensure/repave.gostep added to the reconcile chain - Packer pipeline realigned with
feature-imagebaking; full local test pass (unit + envtest) green - Build, upload, and register the first real image in the catalog
- Real-cluster verification (
database/test/repave-e2e.sh, including the PG-version-EOL stage) - Documentation housekeeping (
databaseDefaults.osVersiondocumented where an operator would find it) - Open PR —
Closes #252, references the design update on #168
Testing
database/test/repave-e2e.sh — stage-based end-to-end runner against a real Harvester cluster (provisioning, drift detection, repave, teardown, PG EOL scenarios). Unit tests cover controller/catalog/harvester-client logic independently.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.