Skip to content

Drop per-component CRD and controller gating from operator install - #5281

Merged
ChrisJBurns merged 3 commits into
mainfrom
helm-crd-wrapper-integration-for-operator-manifest
May 14, 2026
Merged

ChrisJBurns merged 3 commits into
mainfrom
helm-crd-wrapper-integration-for-operator-manifest

Conversation

@ChrisJBurns

@ChrisJBurns ChrisJBurns commented May 14, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Two related changes that move toolhive away from per-component install/runtime gating for operator CRDs and controllers:

  1. Adopt the external stacklok/helm-crd-wrapper binary in place of the in-repo crd-helm-wrapper/ Go program. Sharing one tool across charts (toolhive, stacklok-llm-gateway, …) keeps wrap behavior consistent and removes a copy of the code from this repo. The external tool intentionally has no per-CRD configuration — its README says "either every CRD survives helm uninstall or none do; mixed install groups inside one chart … usually means there should be two charts." We agree.
  2. Remove the operator-side feature-flag gating added in add feature flags to enable/disable controller groups #3093 (ENABLE_SERVER / ENABLE_REGISTRY / ENABLE_VMCP). We never use the ability to run with a partial controller set, and the runtime gating only adds a way to land in a broken half-installed state (e.g. virtualMCP=true with server=false, guarded by an ad-hoc dependency map). All controllers now register unconditionally.

The two changes pair naturally: the chart no longer offers granular install knobs and the operator no longer offers granular runtime knobs, so the install/start path is uniform.

The external helm-crd-wrapper is pinned to commit a736420b because it has no tagged release yet — swap for a tag when one is cut.

Type of change

  • Refactoring (no behavior change)

(Behavior change is limited to the chart values schema — see "user-facing change" below. Default behavior is unchanged for both pieces.)

Test plan

  • Unit tests (task operator-test)
  • Linting (task lint-fix)
  • Manual testing (described below)

Manual verification:

  1. task operator-manifests (from cmd/thv-operator/) regenerates all 13 wrapped CRD templates via the external binary.
  2. helm template test deploy/charts/operator-crds renders 13 CRDs with defaults; --set crds.install=false renders 0.
  3. helm template test deploy/charts/operator renders the operator Deployment with only ENABLE_EXPERIMENTAL_FEATURES remaining among the ENABLE_* env vars.
  4. helm-docs --chart-search-root=deploy/charts regenerates both chart READMEs cleanly.
  5. ct lint --charts deploy/charts/operator-crds passes chart validation (only yamllint-not-installed warning, unrelated).
  6. go build ./cmd/thv-operator/... succeeds; task operator-test passes.

Changes

Chart-level wrapper swap

File Change
cmd/thv-operator/Taskfile.yml operator-manifests now go installs the external binary and invokes it with -source/-target only.
deploy/charts/operator-crds/values.yaml Collapse crds.install.{server,registry,virtualMcp} into a single crds.install: true boolean.
deploy/charts/operator-crds/templates/*.yaml (13 files) Regenerated — first-line conditional becomes {{- if .Values.crds.install }}.
deploy/charts/operator-crds/crd-helm-wrapper/ Deleted (replaced by the external binary).
deploy/charts/operator-crds/.helmignore, .gitignore Drop entries that referenced the deleted directory/binary.
deploy/charts/operator-crds/README.md Regenerated by helm-docs.

Operator controller gating removal

File Change
cmd/thv-operator/main.go Remove feature-flag constants, controllerDependencies map, dispatcher branching, and isFeatureEnabled. setupControllersAndWebhooks now calls each setup helper unconditionally.
cmd/thv-operator/main_test.go Deleted — only tested isFeatureEnabled and the dependency map.
deploy/charts/operator/values.yaml Drop operator.features.{server,registry,virtualMCP}.
deploy/charts/operator/templates/deployment.yaml Drop ENABLE_SERVER / ENABLE_REGISTRY / ENABLE_VMCP env vars.
deploy/charts/operator/README.md Regenerated by helm-docs.

⚠️ Breaking change

This is a breaking change for any consumer who set one of the removed flags to false. Default behavior is unchanged — anyone running on defaults (or who only set them to true) is unaffected — but explicit opt-outs are silently dropped:

  • crds.install.{server,registry,virtualMcp}=false (operator-crds chart): override is ignored; all CRDs install. Most likely affected: consumers who set virtualMcp=false to skip vMCP CRDs.
  • operator.features.{server,registry,virtualMCP}=false (operator chart): override is ignored; all controllers register. Pairs with the above — vMCP opt-outs are the most likely case.
  • ENABLE_SERVER / ENABLE_REGISTRY / ENABLE_VMCP env vars on the operator binary: silently ignored. Operators run outside the chart with these set will start every controller anyway.

No CRD schema or v1beta1 API break. The api-compat.yml check is unaffected.

Migration: remove the old keys from your values files (left in place they are silently ignored). If a consumer was depending on skipping vMCP CRDs/controllers for operational reasons, raise it before merge so we can decide whether to put gating back behind a single coarser knob.

Does this introduce a user-facing change?

Yes — chart consumers who set any of the removed values must update their values files:

# operator-crds chart — before
crds:
  install:
    server: true
    registry: true
    virtualMcp: true

# operator-crds chart — after
crds:
  install: true
# operator chart — before
operator:
  features:
    server: true
    registry: true
    virtualMCP: true

# operator chart — after (these keys removed entirely)

The previous keys are silently ignored after this change. Default behavior (all CRDs installed, all controllers started) is unchanged.

Special notes for reviewers

  • stacklok/helm-crd-wrapper has no tagged release yet, so the Taskfile pins @a736420b58d68304fac3934cce57c67d0a989fe7. Replace with a semver tag once one is cut.
  • The api-compat.yml workflow's comments still reference crd-helm-wrapper generically; they remain accurate (the source-of-truth path files/crds/ is unchanged) so I left them alone.

🤖 Generated with Claude Code

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]>
@github-actions github-actions Bot added size/M Medium PR: 300-599 lines changed and removed size/M Medium PR: 300-599 lines changed labels 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]>
@github-actions github-actions Bot added size/L Large PR: 600-999 lines changed and removed size/M Medium PR: 300-599 lines changed labels May 14, 2026
@ChrisJBurns ChrisJBurns changed the title Use external helm-crd-wrapper for operator CRD chart Drop per-component CRD and controller gating from operator install May 14, 2026
@github-actions github-actions Bot added size/L Large PR: 600-999 lines changed and removed size/L Large PR: 600-999 lines changed labels May 14, 2026
@ChrisJBurns ChrisJBurns added breaks-compatibility A change that breaks compatibility with a previous release breaking-change labels May 14, 2026
@github-actions github-actions Bot added size/L Large PR: 600-999 lines changed and removed size/L Large PR: 600-999 lines changed labels May 14, 2026
@github-actions github-actions Bot added size/L Large PR: 600-999 lines changed and removed size/L Large PR: 600-999 lines changed labels May 14, 2026
@codecov

codecov Bot commented May 14, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 68.37%. Comparing base (594ae1e) to head (76be33a).

Files with missing lines Patch % Lines
cmd/thv-operator/main.go 0.00% 6 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5281   +/-   ##
=======================================
  Coverage   68.36%   68.37%           
=======================================
  Files         619      619           
  Lines       63361    63318   -43     
=======================================
- Hits        43316    43291   -25     
+ Misses      16810    16795   -15     
+ Partials     3235     3232    -3     

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

@amirejaz amirejaz 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.

Two comments in .github/workflows/api-compat.yml (lines 24 and 27) still reference crd-helm-wrapper — should be helm-crd-wrapper now that the Taskfile switched to the external package.

@ChrisJBurns
ChrisJBurns merged commit e0d270b into main May 14, 2026
45 checks passed
@ChrisJBurns
ChrisJBurns deleted the helm-crd-wrapper-integration-for-operator-manifest branch May 14, 2026 15:21
ChrisJBurns added a commit that referenced this pull request May 14, 2026
The Taskfile switched to the external helm-crd-wrapper package in
#5281 but two comments in .github/workflows/api-compat.yml still
referenced the old crd-helm-wrapper name. Update them so the
comments match the tool actually in use.

Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
@ChrisJBurns ChrisJBurns mentioned this pull request May 14, 2026
2 tasks done
ChrisJBurns added a commit to stacklok/docs-website that referenced this pull request Jun 10, 2026
* Remove feature flag CRD install options

Upstream PR stacklok/toolhive#5281 removed the granular CRD install
flags (crds.install.server/registry/virtualMcp); all controllers now
register unconditionally and the chart exposes a single crds.install
boolean. Update the operator deployment guide to match.

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

* Align upgrade CRD guidance with full CRD set

The kubectl upgrade instructions still told readers to apply only the
CRDs they need. Match the install section: apply the complete set.

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

---------

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

Labels

breaking-change breaks-compatibility A change that breaks compatibility with a previous release size/L Large PR: 600-999 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants