Skip to content

Conversation

yrobla
Copy link
Contributor

@yrobla yrobla commented Sep 18, 2025

When using toolhive_use_configmap the operator will create a volume mount from the configmap, in the matching pod. Then proxyrunner needs to check if that file exists, and read the config from there instead of the old --from-configmap behaviour

Closes: #1947

Copy link

codecov bot commented Sep 18, 2025

Codecov Report

❌ Patch coverage is 19.04762% with 17 lines in your changes missing coverage. Please review.
✅ Project coverage is 47.32%. Comparing base (b92b9e7) to head (b4ae245).
⚠️ Report is 26 commits behind head on main.

Files with missing lines Patch % Lines
...d/thv-operator/controllers/mcpserver_controller.go 19.04% 17 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1952      +/-   ##
==========================================
+ Coverage   47.01%   47.32%   +0.31%     
==========================================
  Files         223      233      +10     
  Lines       27659    28661    +1002     
==========================================
+ Hits        13005    13565     +560     
- Misses      13653    14080     +427     
- Partials     1001     1016      +15     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@yrobla yrobla force-pushed the issue-1947 branch 3 times, most recently from 2614378 to 2f89f83 Compare September 18, 2025 11:22
When using toolhive_use_configmap the operator will create
a volume mount from the configmap, in the matching pod. Then proxyrunner
needs to check if that file exists, and read the config from there
instead of the old --from-configmap behaviour

Closes: #1947
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request changes the default behavior of the proxy runner to use file-based configuration discovery instead of the deprecated --from-configmap flag. The operator now volume mounts ConfigMaps to standard filesystem locations, and the proxy runner automatically searches for and loads runconfig.json from these predefined paths.

Key changes:

  • Removed the --from-configmap flag and replaced it with automatic file discovery
  • Added volume mounting of ConfigMaps in the operator when TOOLHIVE_USE_CONFIGMAP=true
  • Updated all test scenarios to verify volume mounting instead of the removed flag

Reviewed Changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
cmd/thv-proxyrunner/app/run.go Replaced --from-configmap flag with automatic file-based configuration discovery
cmd/thv-proxyrunner/app/run_test.go Updated tests to remove ConfigMap flag validation and add file-based configuration tests
cmd/thv-operator/controllers/mcpserver_controller.go Added volume mounting for ConfigMaps instead of using --from-configmap flag
pkg/runner/config_builder.go Added individual transport configuration methods (WithTransport, WithPort, WithTargetPort)
pkg/runner/config_builder_test.go Added comprehensive tests for the new individual transport configuration methods
Test files Updated all test scenarios to validate volume mounting instead of the deprecated flag

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 11 out of 11 changed files in this pull request and generated 6 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@yrobla yrobla marked this pull request as draft September 18, 2025 13:00
@yrobla yrobla force-pushed the issue-1947 branch 15 times, most recently from bddfd85 to 83d3ffe Compare September 19, 2025 08:33
@yrobla yrobla marked this pull request as ready for review September 19, 2025 09:03
JAORMX
JAORMX previously approved these changes Sep 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Mount configmap in k8s as file as volume
3 participants