refactor(manifests): extract shared patches into Kustomize Components#933
refactor(manifests): extract shared patches into Kustomize Components#933
Conversation
Adding a new OpenShift overlay currently requires copying patch files from an existing overlay and hoping nothing was missed. Kustomize Components let overlays compose reusable mixins instead. Split base/ into core/, rbac/, and platform/ sub-kustomizations so future overlays can selectively include only what they need. Extract 10 duplicated patch files into 4 components: - oauth-proxy: OAuth sidecar + service port (production) - postgresql-rhel: RHEL postgres image + unleash init-db - ambient-api-server-db: API server DB connection + init - postgresql-init-scripts: ConfigMap-based DB init (kind/e2e) Each overlay now references shared components instead of maintaining its own copy of identical patches. All 5 overlays produce identical "oc kustomize" output before and after this change. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (41)
💤 Files with no reviewable changes (6)
WalkthroughThe changes restructure the Kustomize configuration to eliminate patch duplication by extracting shared platform-specific capabilities into reusable Kustomize Components. A new base/core layer defines core deployments, and new components for oauth-proxy, postgresql-rhel, postgresql-init-scripts, and ambient-api-server-db encapsulate their respective patches. Overlays now compose these components instead of maintaining independent patch copies. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Comment Tip You can customize the high-level summary generated by CodeRabbit.Configure the |
Summary
base/intocore/,rbac/, andplatform/sub-kustomizations so future overlays can selectively include only what they needoauth-proxy,postgresql-rhel,ambient-api-server-db,postgresql-init-scriptsAdding a new OpenShift overlay (like
mpp-preprod) currently requires copying patch files from an existing overlay and hoping nothing was missed. With components, a new overlay composes the mixins it needs — no copy-paste required.All 5 overlays produce identical
oc kustomizeoutput before and after this change.Fixes #836
Test plan
oc kustomizeoutput diffed against pre-refactoring baselines for all 5 overlays (production, e2e, kind, kind-local, local-dev) — all identical