Skip to content

add feature flags to enable/disable controller groups - #3093

Merged
amirejaz merged 8 commits into
mainfrom
operator-feature-flags
Jan 5, 2026
Merged

amirejaz merged 8 commits into
mainfrom
operator-feature-flags

Conversation

@amirejaz

Copy link
Copy Markdown
Contributor

Summary

Adds operator-side feature flags to complement the CRD installation flags from #2809, allowing users to conditionally enable/disable controller groups at runtime.

Changes

  • Add ENABLE_SERVER, ENABLE_REGISTRY, ENABLE_VMCP environment variables in main.go
  • Refactor setupControllersAndWebhooks to conditionally start controllers based on flags
  • Add dependency checking (VMCP requires Server to be enabled)
  • Wire feature flags through Helm values (operator.features.server/registry/virtualMCP)
  • Update deployment template to pass environment variables

Usage

Skip Virtual MCP controllers (matches crds.install.virtualMcp=false):

helm install operator ... --set operator.features.virtualMCP=false

Related

Complements #2809 (CRD installation feature flags)

@github-actions github-actions Bot added the size/S Small PR: 100-299 lines changed label Dec 18, 2025
@codecov

codecov Bot commented Dec 18, 2025 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 25.00000% with 45 lines in your changes missing coverage. Please review.
✅ Project coverage is 57.16%. Comparing base (dda67b9) to head (dc1442a).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
cmd/thv-operator/main.go 25.00% 45 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3093      +/-   ##
==========================================
- Coverage   57.21%   57.16%   -0.05%     
==========================================
  Files         341      341              
  Lines       34089    34145      +56     
==========================================
+ Hits        19503    19519      +16     
- Misses      12972    13019      +47     
+ Partials     1614     1607       -7     

☔ 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.

@github-actions github-actions Bot added size/S Small PR: 100-299 lines changed and removed size/S Small PR: 100-299 lines changed labels Dec 19, 2025
Comment thread cmd/thv-operator/main.go Resolved

@yrobla yrobla left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

added a comment
also, it's missing tests and documentation

@github-actions github-actions Bot added size/S Small PR: 100-299 lines changed and removed size/S Small PR: 100-299 lines changed labels Dec 22, 2025
@amirejaz
amirejaz requested a review from yrobla December 22, 2025 13:43
yrobla
yrobla previously approved these changes Dec 23, 2025
@github-actions github-actions Bot added size/S Small PR: 100-299 lines changed and removed size/S Small PR: 100-299 lines changed labels Jan 2, 2026
@github-actions github-actions Bot added size/M Medium PR: 300-599 lines changed and removed size/S Small PR: 100-299 lines changed labels Jan 2, 2026
@amirejaz
amirejaz requested a review from yrobla January 2, 2026 12:32
Comment thread cmd/thv-operator/main.go Resolved
@amirejaz
amirejaz merged commit e583700 into main Jan 5, 2026
@amirejaz
amirejaz deleted the operator-feature-flags branch January 5, 2026 09:43
ChrisJBurns added a commit that referenced this pull request May 14, 2026
The ENABLE_SERVER / ENABLE_REGISTRY / ENABLE_VMCP env vars added in
#3093 let chart consumers selectively start controller groups. We
have no remaining use case for partial controller installs — the
chart now ships all CRDs together, and the operator should match.

- Drop feature flag constants, dependency map, and isFeatureEnabled
  helper from main.go; setupControllersAndWebhooks now calls each
  setup helper unconditionally.
- Delete main_test.go (only tested the removed helper).
- Drop operator.features.{server,registry,virtualMCP} from
  values.yaml and the corresponding ENABLE_* env vars from the
  Deployment template.
- Regenerate operator chart README via helm-docs.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
ChrisJBurns added a commit that referenced this pull request May 14, 2026
…5281)

* Use external helm-crd-wrapper for operator CRD chart

Replace the in-repo crd-helm-wrapper Go program with the external
stacklok/helm-crd-wrapper binary. The external tool intentionally
does not support per-CRD feature gating, so the chart now exposes a
single crds.install boolean instead of per-component flags
(crds.install.server / .registry / .virtualMcp).

Pinned to commit a736420b — no tagged release exists yet; swap for a
tag when one is cut.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

* Remove controller feature flag gating from operator

The ENABLE_SERVER / ENABLE_REGISTRY / ENABLE_VMCP env vars added in
#3093 let chart consumers selectively start controller groups. We
have no remaining use case for partial controller installs — the
chart now ships all CRDs together, and the operator should match.

- Drop feature flag constants, dependency map, and isFeatureEnabled
  helper from main.go; setupControllersAndWebhooks now calls each
  setup helper unconditionally.
- Delete main_test.go (only tested the removed helper).
- Drop operator.features.{server,registry,virtualMCP} from
  values.yaml and the corresponding ENABLE_* env vars from the
  Deployment template.
- Regenerate operator chart README via helm-docs.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/M Medium PR: 300-599 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants