✨ support a system-managed install namespace at runtime - #2926
nader-ziada wants to merge 2 commits into
Conversation
…tadata Derive the install namespace from the bundle's CSV rather than requiring the caller to supply one. Resolution order is the suggested-namespace-template name, then the suggested-namespace annotation, then <packageName>-system. Package names that are not usable DNS1123 labels are normalized and given a short hash suffix so distinct packages cannot collide on one namespace. Signed-off-by: Nader Ziada <nziada@redhat.com>
When spec.namespace is empty the applier stops passing WithSelfManagedInstallNamespace, so the renderer resolves the install namespace from bundle metadata and emits the Namespace object itself. This is gated on BoxcutterRuntime; with the gate off an empty spec.namespace is a terminal configuration error rather than a silent fallback. Signed-off-by: Nader Ziada <nziada@redhat.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
✅ Deploy Preview for olmv1 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Description
When spec.namespace is empty the applier stops passing WithSelfManagedInstallNamespace, so the renderer resolves the install namespace from bundle metadata and emits the Namespace object itself. This is gated on BoxcutterRuntime; with the gate off an empty spec.namespace is a terminal configuration error rather than a silent fallback.
summary
applier/provider.go
New IsNamespaceManagementEnabled field. If spec.namespace is empty and the gate is off, Get() returns a terminal config error. If spec.namespace is set, it passes WithSelfManagedInstallNamespace as before; if empty, it omits the option so the renderer resolves the namespace and emits the Namespace object.
applier/boxcutter.go
Migrate() returns early when spec.namespace is empty — a managed-namespace extension never had a Helm release, so there's nothing to migrate.
controllers/clusterextension_reconcile_steps.go
New ValidateInstallNamespace step. Checks a user-provided spec.namespace exists and fails retryably if not, so the user can create it and the next reconcile succeeds. No-ops when the namespace is system-managed.
cmd/operator-controller/main.go
Sets IsNamespaceManagementEnabled from the BoxcutterRuntime gate, and inserts ValidateInstallNamespace(coreClient) into the boxcutter step list between UnpackBundle and ApplyBundleWithBoxcutter.
Tests
Gate coverage in provider_test.go, the migration skip in boxcutter_test.go, and TestValidateInstallNamespace plus a direct test of the system-managed short-circuit in clusterextension_controller_test.go.
Only the namespace existence check is live today. Everything else waits on the CRD change in PR 3.
Reviewer Checklist