Inject BackendReplicas and Redis session config into MCPServer RunConfig#4368
Inject BackendReplicas and Redis session config into MCPServer RunConfig#4368
Conversation
There was a problem hiding this comment.
Pull request overview
This PR extends the operator-generated MCPServer RunConfig (stored in a ConfigMap) to include scaling hints and Redis session storage connection parameters needed by the proxy runner, while keeping sensitive Redis credentials out of the ConfigMap.
Changes:
- Add
SessionRedis(address/db/keyPrefix) torunner.ScalingConfigvia a newSessionRedisConfigtype. - Populate
runConfig.ScalingConfig.BackendReplicasandrunConfig.ScalingConfig.SessionRedisfromMCPServer.spec.backendReplicasandMCPServer.spec.sessionStoragewhen explicitly configured. - Add controller-level unit tests covering nil-passthrough behavior and Redis config injection.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| pkg/runner/config.go | Extends ScalingConfig with optional Redis session connection settings (SessionRedisConfig). |
| cmd/thv-operator/controllers/mcpserver_runconfig.go | Injects backend replica count + Redis session config into the generated RunConfig via populateScalingConfig. |
| cmd/thv-operator/controllers/mcpserver_runconfig_test.go | Adds tests validating scaling/redis fields are present only when configured. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 11580bf3c3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4368 +/- ##
==========================================
- Coverage 69.48% 69.43% -0.05%
==========================================
Files 485 485
Lines 49542 49576 +34
==========================================
+ Hits 34422 34424 +2
- Misses 12454 12484 +30
- Partials 2666 2668 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
31e22a5 to
6788d84
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Populates ScalingConfig in the MCPServer RunConfig ConfigMap from spec.backendReplicas and spec.sessionStorage. Adds SessionRedisConfig (address, db, keyPrefix) to runner.ScalingConfig; the Redis password is intentionally excluded and injected as a pod env var instead. Both fields use nil-passthrough so unset specs leave the RunConfig fields absent (HPA/external controllers remain authoritative). Closes: #4218
Summary
Populates ScalingConfig in the MCPServer RunConfig ConfigMap from spec.backendReplicas and spec.sessionStorage. Adds SessionRedisConfig (address, db, keyPrefix) to runner.ScalingConfig; the Redis password is intentionally excluded and injected as a pod env var instead. Both fields use nil-passthrough so unset specs leave the RunConfig fields absent (HPA/external controllers remain authoritative).
Fixes #4218
Type of change
Test plan
task test)task test-e2e)task lint-fix)Changes
Does this introduce a user-facing change?
Special notes for reviewers