Conversation
…s imported to che-operator Signed-off-by: Anatolii Bazko <abazko@redhat.com>
|
Skipping CI for Draft Pull Request. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: tolusha 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 |
…s imported to che-operator Signed-off-by: Anatolii Bazko <abazko@redhat.com>
…s imported to che-operator Signed-off-by: Anatolii Bazko <abazko@redhat.com>
…s imported to che-operator Signed-off-by: Anatolii Bazko <abazko@redhat.com>
…s imported to che-operator Signed-off-by: Anatolii Bazko <abazko@redhat.com>
…s imported to che-operator Signed-off-by: Anatolii Bazko <abazko@redhat.com>
…s imported to che-operator Signed-off-by: Anatolii Bazko <abazko@redhat.com>
…s imported to che-operator Signed-off-by: Anatolii Bazko <abazko@redhat.com>
…s imported to che-operator Signed-off-by: Anatolii Bazko <abazko@redhat.com>
…s imported to che-operator Signed-off-by: Anatolii Bazko <abazko@redhat.com>
…s imported to che-operator Signed-off-by: Anatolii Bazko <abazko@redhat.com>
…s imported to che-operator Signed-off-by: Anatolii Bazko <abazko@redhat.com>
|
Hi! I'm che-ai-assistant — I help with your pull requests. Available commands:
|
|
/che-ai-assistant ok-pr-review Review is complete. Please check the review comments below. |
tolusha
left a comment
There was a problem hiding this comment.
Comprehensive Review Summary
I've completed a thorough multi-dimensional review of this PR:
- ✅ Standard Review: Approve - ready to merge
- ✅ Deep Review: Design is sound
- ✅ Impact Review: No system-level concerns
Key Strengths
Excellent test coverage: 8 test cases for the new TLS ConfigMap ref feature covering all edge cases (creation, update, removal, empty data, idempotency). The composition tests for proxy + TLS settings show attention to integration concerns.
Clean test file organization: Breaking the 3328-line monolithic test into 6 domain-specific files (routing, scheduling, security, service account, storage, workspace) greatly improves maintainability.
Proper resource lifecycle: Owner references ensure ConfigMaps are garbage-collected when CheCluster is deleted. The deliberate exclusion of admin-created resources (git trusted certs) shows understanding of K8s ownership semantics.
Type-safe DWO integration: The controller.devfile.io/watch-configmap=true label and TLSCertificateConfigmapRef use imported constants from the DevWorkspace Operator module - no magic strings.
Consistent refactoring: Migration from deprecated deploy.Get() to ClientWrapper.GetIgnoreNotFound() is applied uniformly across all call sites.
Minor Suggestions
-
Test coverage gap: The
updateTLSCertificateConfigmapReferror path (whenGetIgnoreNotFoundfails) isn't exercised in tests. Consider adding a test case that simulates a client error when fetching the ConfigMap. -
Diff pattern documentation: In
syncCheCABundleCerts(certificates.go:455), the shift to usingGetLabelsAndAnnotations(mergedCABundlesCM)for diff keys is clever but creates an implicit dependency on label ordering. Consider adding a comment documenting that labels must be set on the blueprint before this call. -
Optional helper extraction: The pattern of
SetControllerReference+ClientWrapper.Sync+return err == nil, errappears in 5 methods. ASyncOwned(ctx, owner, blueprint, opts)helper could reduce boilerplate, though the current code is correct.
Verdict
✅ Approve - This PR is well-designed, thoroughly tested, and ready to merge. The TLS certificate integration is correctly implemented and the refactoring away from deprecated helpers is clean and consistent.
📊 Review completed: Standard + Deep + Impact analysis
|
/che-ai-assistant generate-che-doc Created documentation PR: eclipse-che/che-docs#3128 |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #2137 +/- ##
==========================================
+ Coverage 50.09% 50.12% +0.02%
==========================================
Files 94 101 +7
Lines 12569 13234 +665
==========================================
+ Hits 6297 6633 +336
- Misses 5853 6134 +281
- Partials 419 467 +48 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
| type testCase struct { | ||
| name string | ||
| cheCluster *chev2.CheCluster | ||
| existedObjects []client.Object |
There was a problem hiding this comment.
I notice in TestReconcileDevWorkspaceContainerSecurityContext and TestReconcileDevWorkspacePodSecurityContext test cases define existedObjects, but the test context is created with
deployContext := test.NewCtxBuilder().WithCheCluster(testCase.cheCluster).Build()Should deployContext include existedObjects so that updated paths are also tested?
| } | ||
|
|
||
| var unmasked = corev1.UnmaskedProcMount | ||
| var testCases = []testCase{ |
There was a problem hiding this comment.
Nit (optional): testCases := []testCase{} could be used here since the type is already apparent from the composite literal, though this is mostly a style preference.
|
|
||
| var testCases = []testCase{ | ||
| { | ||
| name: "Case #1", |
There was a problem hiding this comment.
Nit: Could we use descriptive test names instead of Case #1, Case #2, etc.? It makes failures much easier to interpret from the test output without opening the test file.
| name: "Case #1", | |
| name: "ServiceAccount configured with auto-provision enabled", |
…s imported to che-operator
What does this PR do?
This PR configures the DevWorkspace Operator to use Che's merged CA bundle for TLS by setting tlsCertificateConfigmapRef in the DWI routing config when custom certificates are imported, and adding a watch label so DWO picks up changes. It also refactors the TLS certificate reconciliation to use newer client APIs, adds owner references, removes deprecated sync helpers, and splits a large test file into domain-specific ones.
Screenshot/screencast of this PR
N/A
What issues does this PR fix or reference?
eclipse-che/che#23870
How to test this PR?
Deploy the operator:
chectl server:deploy -p openshift --che-operator-image quay.io/abazko/che-operator:nextCreate k8s resources to host a parent devfile:
Ensure parent devfile is accessible by url
https://parent-parent.<openshift-base-domain>/devfile.yaml(for instancehttps://parent-parent.apps-crc.testing/devfile.yaml)Import certificate into Che
Check that DWO is configured
oc get dwoc -n eclipse-che devworkspace-config -o jsonpath="{.config.routing}"Start a workspace from
https://gist.githubusercontent.com/tolusha/6c68d907a52d235b311f196478ce08b6/raw/d94a38042093d9a5fe021091d861cb9ea15ac78e/devfile.yamlCommon Test Scenarios
PR Checklist
As the author of this Pull Request I made sure that:
Reviewers
Reviewers, please comment how you tested the PR when approving it.