-
Notifications
You must be signed in to change notification settings - Fork 148
Add option to skip Virtual MCP CRDs installation #2729
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
JAORMX
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's also add an environment variable to disable the controllers if this is enabled.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2729 +/- ##
==========================================
- Coverage 55.67% 55.61% -0.06%
==========================================
Files 314 314
Lines 30486 30520 +34
==========================================
+ Hits 16972 16974 +2
- Misses 12025 12057 +32
Partials 1489 1489 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Add Feature Flags for Controller Groups and Optional Virtual MCP CRD Installation
Summary
This PR implements feature flags to enable/disable controller groups in the ToolHive operator and adds the ability to skip installing Virtual MCP CRDs. This allows users to deploy a minimal operator configuration when they only need core MCP server management features.
Related Issues
Changes
1. Feature Flags Implementation
Added three environment variable flags to control controller groups:
ENABLE_SERVER(default:true)ENABLE_REGISTRY(default:true)ENABLE_AGGREGATION(default:true)ENABLE_SERVER=true(validated with warning log)2. Optional Virtual MCP CRD Installation
Added
crds.install.virtualMCPoption to thetoolhive-operator-crdsHelm chart:false: Skips installing VirtualMCPServer and VirtualMCPCompositeToolDefinition CRDsENABLE_AGGREGATION=falsein the operator to prevent controller errors3. Code Refactoring
Refactored
setupControllersAndWebhooksfunction into smaller, focused functions:setupServerControllers()- Sets up server-related controllerssetupRegistryController()- Sets up registry controllersetupAggregationControllers()- Sets up aggregation controllers and webhooksThis improves maintainability and makes the code easier to test.
4. Image Validation Logic
Fixed image validation mode selection:
ENABLE_REGISTRY=true: MCPServer usesImageValidationRegistryEnforcingENABLE_REGISTRY=false: MCPServer usesImageValidationAlwaysAllowUsage Examples
Minimal Deployment (Core Server Management Only)
Registry-Only Deployment
# Enable only server and registry features helm upgrade -i toolhive-operator oci://ghcr.io/stacklok/toolhive/toolhive-operator \ -n toolhive-system --create-namespace \ --set operator.env.ENABLE_AGGREGATION=falseBackward Compatibility
truewhen not settrue(installs all CRDs)Documentation
operator-crds/README.mdwith feature flags documentationoperator/values.yamlwith feature flag commentsTesting