Skip to content

✨ support a system-managed install namespace at runtime - #2926

Draft
nader-ziada wants to merge 2 commits into
operator-framework:mainfrom
nader-ziada:feat/managed-namespace-runtime
Draft

nader-ziada wants to merge 2 commits into
operator-framework:mainfrom
nader-ziada:feat/managed-namespace-runtime

Conversation

@nader-ziada

Copy link
Copy Markdown

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.

second of three PRs splitting #2825. This one is applier. stacked on top #2925 so should have the 2nd commit only.

validateSystemManagedNamespaceUnchanged from the original branch is deliberately omitted while the requirement is being discussed. It blocked an upgrade whose bundle resolves to a different namespace, by listing namespaces with the extension's owner labels and comparing.

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

  • API Go Documentation
  • Tests: Unit Tests (and E2E Tests, if appropriate)
  • Comprehensive Commit Messages
  • Links to related GitHub Issue(s)

…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>
@openshift-ci openshift-ci Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Sep 16, 2026
@openshift-ci

openshift-ci Bot commented Sep 16, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign perdasilva for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@coderabbitai

coderabbitai Bot commented Sep 16, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@netlify

netlify Bot commented Sep 16, 2026

Copy link
Copy Markdown

Deploy Preview for olmv1 ready!

Name Link
🔨 Latest commit 65b8acb
🔍 Latest deploy log https://app.netlify.com/projects/olmv1/deploys/6aaaea93d76daa00098bcc2d
😎 Deploy Preview https://deploy-preview-2926--olmv1.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant