Repository navigation
fix: resolve workspace-referenced DWOC only from the operator namespace - #1753
rohanKanojia wants to merge 1 commit into
Conversation
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>
|
Skipping CI for Draft Pull Request. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: rohanKanojia 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: 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. |
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
What does this PR do?
Resolves a workspace-referenced
DevWorkspaceOperatorConfig(DWOC) only from the DevWorkspace Operator's installation namespace.Previously, the
controller.devfile.io/devworkspace-configattribute on aDevWorkspacenamed a DWOC by{name, namespace}, andResolveConfigForWorkspaceread 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:
nameis still honored. The named DWOC is always read from the operator installation namespace.namespaceis 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.ResolveConfigForWorkspace, the single resolution point shared by the controller reconcile, eventhandlers, the webhook handler, and the backup cronjob.Behavior when the named config is not found in the operator namespace is unchanged from any other failed lookup:
DevWorkspacewithstarted: true.What issues does this PR fix or reference?
Is it tested? How?
PR Checklist
/test v8-devworkspace-operator-e2e, v8-che-happy-pathto trigger)v8-devworkspace-operator-e2e: DevWorkspace e2e testv8-che-happy-path: Happy path for verification integration with Che