Skip to content

fix: resolve workspace-referenced DWOC only from the operator namespace - #1753

Draft
rohanKanojia wants to merge 1 commit into
devfile:mainfrom
rohankanojia-forks:pr/drop-namespace-devworkspace-config-attribute
Draft

rohanKanojia wants to merge 1 commit into
devfile:mainfrom
rohankanojia-forks:pr/drop-namespace-devworkspace-config-attribute

Conversation

@rohanKanojia

@rohanKanojia rohanKanojia commented Dec 4, 2026 •

Copy link
Copy Markdown
Member

What does this PR do?

⚠️ To be merged after eclipse-che/che-operator#2291

Resolves a workspace-referenced DevWorkspaceOperatorConfig (DWOC) only from the DevWorkspace Operator's installation namespace.

Previously, the controller.devfile.io/devworkspace-config attribute on a DevWorkspace named a DWOC by {name, namespace}, and ResolveConfigForWorkspace read that object from whatever namespace the attribute named and merged it over the global config. Operator configuration is meant to be administrator-controlled, so it should only be read from a trusted location.

With this change:

  • The attribute's name is still honored. The named DWOC is always read from the operator installation namespace.
  • The attribute's namespace is ignored and is now optional. Existing workspaces that set it stay valid. A DWOC in any other namespace (including the workspace's own) is no longer applied.
  • Enforcement lives inside ResolveConfigForWorkspace, the single resolution point shared by the controller reconcile, eventhandlers, the webhook handler, and the backup cronjob.
  • A clear error is returned when the named config is absent from the operator namespace (the ignored attribute namespace is included in the message for debuggability).

Behavior when the named config is not found in the operator namespace is unchanged from any other failed lookup:

  • The webhook denies creating or updating a DevWorkspace with started: true.
  • For a workspace that is already past the webhook, the controller adds a warning and uses the global config.

What issues does this PR fix or reference?

Is it tested? How?

PR Checklist

  • E2E tests pass (when PR is ready, comment /test v8-devworkspace-operator-e2e, v8-che-happy-path to trigger)
    • v8-devworkspace-operator-e2e: DevWorkspace e2e test
    • v8-che-happy-path: Happy path for verification integration with Che

The controller.devfile.io/devworkspace-config attribute let a DevWorkspace
reference a DevWorkspaceOperatorConfig in any namespace, which was then merged
over the global config. Operator configuration is meant to be
administrator-controlled, so it should only be read from a trusted location.

Resolve the referenced config's name only from the operator installation
namespace, ignoring the namespace supplied in the attribute. The attribute is
retained for backward compatibility so existing workspace manifests stay valid;
its namespace field is now optional, and a config in any other namespace
(including the workspace's own) is no longer applied.

Requires the che-operator counterpart to be rolled out first:
eclipse-che/che-operator#2291

Assisted-by: Claude Code
Signed-off-by: Rohan Kumar <rohaan@redhat.com>
@openshift-ci

openshift-ci Bot commented Dec 4, 2026

Copy link
Copy Markdown

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@openshift-ci

openshift-ci Bot commented Dec 4, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: rohanKanojia
Once this PR has been reviewed and has the lgtm label, please assign dkwon17 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 Dec 4, 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
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@codecov

codecov Bot commented Dec 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 45.42%. Comparing base (3526ad3) to head (f866569).
⚠️ Report is 48 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1753      +/-   ##
==========================================
+ Coverage   40.45%   45.42%   +4.96%     
==========================================
  Files         174      179       +5     
  Lines       15949    13573    -2376     
==========================================
- Hits         6452     6165     -287     
+ Misses       9096     6944    -2152     
- Partials      401      464      +63     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant