fix: Use the merged DevWorkspaceOperatorConfig instead of only the global config to initialize HTTP clients#1647
Conversation
…e http client Signed-off-by: Anatolii Bazko <abazko@redhat.com>
|
[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 |
|
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.
Code Review Summary
I've completed a comprehensive review (standard, deep, and impact analysis) of this PR. Overall, this is well-designed code with excellent test coverage and thoughtful security considerations. The PR successfully addresses the stated issue (eclipse-che/che#23870) by enabling namespace-level TLS certificate configuration.
Key Highlights:
- ✅ Well-designed
HttpClientsHolderinterface with clean separation of concerns - ✅ Smart rebuild optimization to avoid unnecessary HTTP client recreation
- ✅ Correct cert pool handling (cloning before mutation)
- ✅ Thorough test coverage with 8 test cases
- ✅ Good security documentation (InsecureSkipVerify scope clearly noted)
- ✅ Response body leak fix in status.go
Areas for Discussion:
I've posted inline comments on a few operational concerns and suggestions for improvement. The two main items worth discussing are:
- New 5-second timeout - This is a behavioral change that improves safety but could affect slow proxy environments
- Certificate parsing log level - Currently at debug level, production users won't see parse failures
Neither is a blocker, but both affect production observability and behavior.
See inline comments for details and additional suggestions.
| globalConfig := config.GetGlobalConfig() | ||
| httpClientsHolder = &DefaultHttpClientsHolder{ | ||
| k8s: k8s, | ||
| logger: logger, |
There was a problem hiding this comment.
httpClientsHolder is a single global variable, but ConfigureHttpClients is called per-workspace with that workspace's merged config. If two namespaces have different proxy or cert settings in their namespace-specific DWOCs, concurrent reconciliations will overwrite each other's HTTP client configuration.
This is acceptable for the immediate use case (single Che deployment), but could cause subtle issues in multi-tenant deployments. Consider adding a brief comment on the global variable noting this limitation to help future maintainers understand the design boundary.
What does this PR do?
What issues does this PR fix or reference?
eclipse-che/che#23870
eclipse-che/che-operator#2137
Is it tested? How?
Followed eclipse-che/che-operator#2137
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