wso2 / wso2/open-cloud-datacenter

[Feature] Extend Baked Image & Repave (M1) to the bounded Step/Runner controller

Open
#252 0 comments 0 reactions 1 assignee View on GitHub

@tgcjananga is already working on this.

Since Aug 28, 2026.

Area/Operators Severity/Blocker
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/DeletePVC on ClientInterface/TypedClient/StubHarvester
  • Controller wiring — preflight/vm resolve against the catalog, dead OSImage refs removed, internal/ensure/repave.go step 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.osVersion documented 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.