Commit 3dbbf5a
authored
Graduate CRDs from v1alpha1 to v1beta1 (#4849)
* Graduate CRDs from v1alpha1 to v1beta1
Signal API stability by promoting all ToolHive CRDs to v1beta1 while
preserving backwards compatibility — the CRDs serve both versions
simultaneously so existing v1alpha1 resources survive the upgrade
untouched and users migrate manifests at their own pace.
v1alpha1 and v1beta1 are schema-identical. The new
cmd/thv-operator/api/v1alpha1/ package defines only the root resource
types (MCPServer, MCPGroup, ...) as thin wrappers whose Spec and Status
fields reference the canonical types from v1beta1. controller-gen walks
field types when building the OpenAPI schema, so both versions resolve
to the same schema without any duplication of the actual model — I
verified empirically that all 12 CRDs produce structurally identical
schemas (modulo the legitimately-different root descriptions).
The upgrade is orchestrated through the `served` and `storage` flags
on each version entry: the new CRDs list both versions as served, mark
v1beta1 as storage, and mark v1alpha1 as deprecated with a warning.
No conversion webhook is configured, which defaults to strategy: None
— safe because the schemas are identical. Kubernetes swaps the
apiVersion string when serving an object at a different version than
it was stored at. Users can upgrade the CRD chart without deleting
anything, keep reading/writing at v1alpha1 indefinitely, and migrate
to v1beta1 by re-applying manifests. Once status.storedVersions no
longer contains v1alpha1, a future release can drop the v1alpha1
entry and remove the wrapper package.
What changed:
- Mechanical rename from v1alpha1 to v1beta1 across all Go imports,
YAML apiVersion strings, Helm deploy manifests, chainsaw fixtures,
examples, docs, and generated artifacts.
- New cmd/thv-operator/api/v1alpha1/ package: 12 root types + 12 list
types as thin wrappers over v1beta1 Spec/Status, plus scheme
registration. Each root type carries a +kubebuilder:deprecatedversion
warning so kubectl prints a migration hint on every access.
- Register both schemes in cmd/thv-operator/main.go.
- Regenerated CRD manifests list both versions (v1alpha1 deprecated
and non-storage, v1beta1 storage) with conversion.strategy: None.
- Removed the obsolete pre-upgrade Helm hook that blocked upgrades
when v1alpha1 resources existed — no longer needed since those
resources now survive the upgrade.
- Drive-by: regenerate pkg/audit/zz_generated.deepcopy.go which had
drifted after DetectApplicationErrors was added to Config without
re-running controller-gen.
Closes #2556
* Update test files to use v1beta1 after merge
Two test files that came in via the merge from main still reference
the v1alpha1 Go package, which no longer exists on this branch. The
operator binaries compile fine, but CI lint/test fail on the missing
mcpv1alpha1 symbol in the test package.
- cmd/thv-operator/controllers/mcpremoteproxy_deployment_test.go
- cmd/thv-operator/controllers/mcpserver_resource_overrides_test.go
Applied the same mcpv1alpha1 → mcpv1beta1 rename that the rest of
the branch uses. No behavioural change.1 parent 117be04 commit 3dbbf5a
384 files changed
Lines changed: 27197 additions & 12094 deletions
File tree
- .claude/skills/implement-story
- cmd
- thv-operator
- api
- v1alpha1
- v1beta1
- config/webhook
- controllers
- pkg
- controllerutil
- oidc
- mocks
- registryapi
- mocks
- runconfig
- spectoconfig
- validation
- virtualmcpserverstatus
- mocks
- vmcpconfig
- test-integration
- embedding-server
- mcp-external-auth
- mcp-group
- mcp-oidc-config
- mcp-registry
- mcp-remote-proxy
- mcp-server
- mcp-telemetry-config
- mcp-toolconfig
- virtualmcp
- vmcp
- config/webhook
- deploy
- charts/operator-crds
- files/crds
- templates
- keycloak
- docs
- arch
- operator
- templates/markdown
- server
- examples
- operator
- embedding-servers
- external-auth
- mcp-registries
- mcp-server-entries
- mcp-servers
- redis-storage
- tool-configs
- vault
- virtual-mcps
- pkg
- audit
- export
- groups
- operator/accessors
- ratelimit
- runner
- vmcp
- auth
- converters
- factory
- k8s
- status
- workloads
- test/e2e
- chainsaw/operator
- multi-tenancy/test-scenarios
- embeddingserver
- sse
- stdio-streamable-http
- stdio
- streamable-http
- single-tenancy/test-scenarios
- embeddingserver
- basic
- lifecycle
- with-cache
- pod-annotations
- sse
- stdio-streamable-http
- stdio
- streamable-http
- vmcp
- basic
- validation
- mcpexternalauthconfig
- virtualmcpserver
- thv-operator
- acceptance_tests
- testutil
- virtualmcp
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
170 | 170 | | |
171 | 171 | | |
172 | 172 | | |
173 | | - | |
| 173 | + | |
174 | 174 | | |
175 | 175 | | |
176 | 176 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
15 | | - | |
| 14 | + | |
| 15 | + | |
16 | 16 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
139 | | - | |
| 139 | + | |
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
| |||
165 | 165 | | |
166 | 166 | | |
167 | 167 | | |
168 | | - | |
| 168 | + | |
169 | 169 | | |
170 | 170 | | |
171 | 171 | | |
| |||
272 | 272 | | |
273 | 273 | | |
274 | 274 | | |
275 | | - | |
| 275 | + | |
276 | 276 | | |
277 | 277 | | |
278 | 278 | | |
| |||
350 | 350 | | |
351 | 351 | | |
352 | 352 | | |
353 | | - | |
| 353 | + | |
354 | 354 | | |
355 | 355 | | |
356 | 356 | | |
| |||
369 | 369 | | |
370 | 370 | | |
371 | 371 | | |
372 | | - | |
| 372 | + | |
373 | 373 | | |
374 | 374 | | |
375 | 375 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
| 36 | + | |
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| |||
171 | 171 | | |
172 | 172 | | |
173 | 173 | | |
174 | | - | |
| 174 | + | |
175 | 175 | | |
176 | 176 | | |
177 | 177 | | |
| |||
501 | 501 | | |
502 | 502 | | |
503 | 503 | | |
504 | | - | |
| 504 | + | |
505 | 505 | | |
506 | 506 | | |
507 | 507 | | |
| |||
523 | 523 | | |
524 | 524 | | |
525 | 525 | | |
526 | | - | |
| 526 | + | |
527 | 527 | | |
528 | 528 | | |
529 | 529 | | |
| |||
554 | 554 | | |
555 | 555 | | |
556 | 556 | | |
557 | | - | |
| 557 | + | |
558 | 558 | | |
559 | 559 | | |
560 | 560 | | |
| |||
586 | 586 | | |
587 | 587 | | |
588 | 588 | | |
589 | | - | |
| 589 | + | |
590 | 590 | | |
591 | 591 | | |
592 | 592 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | 4 | | |
8 | 5 | | |
9 | 6 | | |
| |||
12 | 9 | | |
13 | 10 | | |
14 | 11 | | |
15 | | - | |
| 12 | + | |
16 | 13 | | |
17 | 14 | | |
18 | | - | |
| 15 | + | |
19 | 16 | | |
20 | 17 | | |
21 | 18 | | |
| |||
0 commit comments