Add CA bundle volume mount and validation for MCPRemoteProxy#4190
Add CA bundle volume mount and validation for MCPRemoteProxy#4190majiayu000 wants to merge 10 commits intostacklok:mainfrom
Conversation
MCPRemoteProxy was missing CA bundle support that already existed in MCPServer. This adds two features: 1. OIDC CA bundle volume mount in buildVolumesForProxy() so that custom CA certificates are available to the proxy container. 2. CA bundle ConfigMap validation in validateAndHandleConfigs() that checks the referenced ConfigMap exists and contains the expected key, setting appropriate status conditions. Signed-off-by: majiayu000 <1835304752@qq.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4190 +/- ##
==========================================
+ Coverage 68.85% 69.25% +0.40%
==========================================
Files 467 477 +10
Lines 46983 48120 +1137
==========================================
+ Hits 32349 33326 +977
- Misses 11974 12217 +243
+ Partials 2660 2577 -83 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Are there any integration tests that we can add to this? |
Add WithCABundleRef builder helper and 4 integration test cases to verify the CA bundle ConfigMap reference validation end-to-end: valid ConfigMap with correct key, missing ConfigMap, wrong key in ConfigMap, and no CA bundle configured. Signed-off-by: majiayu000 <1835304752@qq.com>
Add three additional test cases to TestMCPRemoteProxyValidateCABundleRef: - CABundleRef with nil ConfigMapRef (early return branch) - CABundleRef with empty ConfigMap name (ValidateCABundleSource error) - Valid CABundleRef with default key fallback (empty key branch) This brings validateCABundleRef to 100% coverage. Signed-off-by: majiayu000 <1835304752@qq.com>
…resolution Cover previously untested branches in validateOIDCIssuerURL, validateJWKSURL, and serviceAccountNameForRemoteProxy to address Codecov patch coverage gaps. Signed-off-by: majiayu000 <1835304752@qq.com>
Cover missing Codecov branches: inline OIDC HTTP issuer rejection, inline JWKS URL validation, authz ConfigMap reference errors, header secret reference errors, and nil ValueSecretRef skip path. Signed-off-by: majiayu000 <1835304752@qq.com>
There was a problem hiding this comment.
Large PR Detected
This PR exceeds 1000 lines of changes and requires justification before it can be reviewed.
How to unblock this PR:
Add a section to your PR description with the following format:
## Large PR Justification
[Explain why this PR must be large, such as:]
- Generated code that cannot be split
- Large refactoring that must be atomic
- Multiple related changes that would break if separated
- Migration or data transformationAlternative:
Consider splitting this PR into smaller, focused changes (< 1000 lines each) for easier review and reduced risk.
See our Contributing Guidelines for more details.
This review will be automatically dismissed once you add the justification section.
Cover uncovered branches flagged by Codecov: - validateOIDCIssuerURL/validateJWKSURL with nil config structs - validateSpec with unsupported OIDC issuer scheme - ensureService update path with drifted session affinity Signed-off-by: majiayu000 <1835304752@qq.com>
…bset check Cover remaining Codecov-flagged branches: - updateCABundleStatusForProxy error path (Status().Update failure) - deploymentMetadataNeedsUpdate with MapIsSubset annotation check Signed-off-by: majiayu000 <1835304752@qq.com>
…nd handleExternalAuthConfig Signed-off-by: majiayu000 <1835304752@qq.com>
Signed-off-by: majiayu000 <1835304752@qq.com>
Summary
AddOIDCCABundleVolumes()call inbuildVolumesForProxy()to mount CA bundle ConfigMaps into the proxy containervalidateCABundleRef()method to the reconciler that validates the referenced ConfigMap exists and contains the expected key, mirroring the MCPServer patternConditionTypeMCPRemoteProxyCABundleRefValidatedcondition type for status reportingFixes #4113
Type of change
Changes
mcpremoteproxy_types.goConditionTypeMCPRemoteProxyCABundleRefValidatedconstantmcpremoteproxy_deployment.goAddOIDCCABundleVolumes()call inbuildVolumesForProxy()mcpremoteproxy_controller.govalidateCABundleRef(),updateCABundleStatusForProxy(),setCABundleRefConditionForProxy()methods and call fromvalidateAndHandleConfigs()mcpremoteproxy_deployment_test.gomcpremoteproxy_controller_test.goTestMCPRemoteProxyValidateCABundleRefwith 4 casesTest plan
go build ./...passestask lint-fixpasses with 0 issuesgo test ./cmd/thv-operator/controllers/...passesDoes this introduce a user-facing change?
MCPRemoteProxy now supports OIDC CA bundle ConfigMap references, matching the existing MCPServer behavior. Users can configure custom CA certificates for OIDC providers by setting
caBundlein their OIDC configuration.