Commit 691f73a
Add TelemetryConfigRef support to MCPRemoteProxy (#4719)
* Add TelemetryConfigRef field and condition constants to MCPRemoteProxy
Brings MCPRemoteProxy to parity with MCPServer's telemetry API by adding
a TelemetryConfigRef field for referencing shared MCPTelemetryConfig
resources. Includes CEL mutual exclusivity validation with the deprecated
inline Telemetry field, TelemetryConfigHash in status for change
detection, and condition type/reason constants.
Part of #4620
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Add GetTelemetryConfigForMCPRemoteProxy helper
Namespace-scoped fetch for MCPTelemetryConfig referenced by an
MCPRemoteProxy. Returns (nil, nil) when the ref is nil or the resource
is not found, matching the MCPServer getTelemetryConfigForMCPServer
contract.
Part of #4620
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Add handleTelemetryConfig and MCPTelemetryConfig watch for MCPRemoteProxy
Wire up the reconciler to validate referenced MCPTelemetryConfig
resources, track config hashes in status, and reconcile when the
underlying MCPTelemetryConfig changes. Follows the same handler pattern
as handleToolConfig and the MCPServer telemetry handler.
Part of #4620
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Prefer TelemetryConfigRef over inline Telemetry in MCPRemoteProxy RunConfig
When building the RunConfig, resolve telemetry from the referenced
MCPTelemetryConfig first and fall back to the deprecated inline
Telemetry field. Adds ctx parameter to createRunConfigFromMCPRemoteProxy
to support the API fetch, matching the MCPServer runconfig pattern.
Part of #4620
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Regenerate deepcopy, CRD manifests, and API docs
Auto-generated from MCPRemoteProxy type changes: adds
telemetryConfigRef to CRD schema with CEL mutual exclusivity validation,
telemetryConfigHash to status, and updated API reference docs.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Fix lint issues and extract helpers to reduce cyclomatic complexity
Extract resolveToolConfig and addTelemetryOptions from
createRunConfigFromMCPRemoteProxy to bring cyclomatic complexity below
the threshold. Rename shadowed ctx to apiCtx for clarity.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Address review feedback for TelemetryConfigRef support
Five fixes from code review:
1. Add +kubebuilder:rbac marker for mcptelemetryconfigs on
MCPRemoteProxyReconciler — required for runtime API access
2. Extend MCPTelemetryConfigReconciler.findReferencingWorkloads to scan
MCPRemoteProxy in addition to MCPServer, fixing deletion protection
and referencingWorkloads status. Add MCPRemoteProxy watch to
SetupWithManager for the reverse-direction reconciliation
3. Mount telemetry CA bundle volumes in proxy deployment via
addTelemetryCABundleVolumes — without this, caBundleRef users get
file-not-found at proxy startup
4. Fix condition removal not persisted when TelemetryConfigHash is
already empty — check for stale condition before deciding whether
to call Status().Update()
5. Fix test assertions to re-fetch persisted state from fakeClient
instead of reading in-memory pointers. Add recovery-from-False and
stale-condition-removal test cases
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Add integration tests for MCPRemoteProxy telemetry config ref
Two new integration tests in the mcp-telemetry-config suite:
1. MCPRemoteProxy tracked in ReferencingWorkloads — creates a proxy
referencing an MCPTelemetryConfig and asserts the proxy appears in
status.referencingWorkloads via the MCPRemoteProxy watch handler.
2. Deletion protection for proxy-only references — verifies that the
finalizer blocks deletion while an MCPRemoteProxy references the
config, and allows deletion after the proxy is removed.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 570615e commit 691f73a
File tree
14 files changed
+995
-46
lines changed- cmd/thv-operator
- api/v1alpha1
- controllers
- pkg/controllerutil
- test-integration/mcp-telemetry-config
- deploy/charts/operator-crds
- files/crds
- templates
- docs/operator
14 files changed
+995
-46
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
| |||
102 | 103 | | |
103 | 104 | | |
104 | 105 | | |
105 | | - | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
106 | 117 | | |
107 | 118 | | |
108 | 119 | | |
| |||
174 | 185 | | |
175 | 186 | | |
176 | 187 | | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
177 | 192 | | |
178 | 193 | | |
179 | 194 | | |
| |||
227 | 242 | | |
228 | 243 | | |
229 | 244 | | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
230 | 248 | | |
231 | 249 | | |
232 | 250 | | |
| |||
278 | 296 | | |
279 | 297 | | |
280 | 298 | | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
281 | 311 | | |
282 | 312 | | |
283 | 313 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 137 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
51 | 52 | | |
52 | 53 | | |
53 | 54 | | |
| |||
128 | 129 | | |
129 | 130 | | |
130 | 131 | | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
131 | 142 | | |
132 | 143 | | |
133 | 144 | | |
| |||
641 | 652 | | |
642 | 653 | | |
643 | 654 | | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
644 | 746 | | |
645 | 747 | | |
646 | 748 | | |
| |||
1390 | 1492 | | |
1391 | 1493 | | |
1392 | 1494 | | |
| 1495 | + | |
| 1496 | + | |
| 1497 | + | |
| 1498 | + | |
| 1499 | + | |
| 1500 | + | |
| 1501 | + | |
| 1502 | + | |
| 1503 | + | |
| 1504 | + | |
| 1505 | + | |
| 1506 | + | |
| 1507 | + | |
| 1508 | + | |
| 1509 | + | |
| 1510 | + | |
| 1511 | + | |
| 1512 | + | |
| 1513 | + | |
| 1514 | + | |
| 1515 | + | |
| 1516 | + | |
| 1517 | + | |
| 1518 | + | |
| 1519 | + | |
| 1520 | + | |
| 1521 | + | |
| 1522 | + | |
| 1523 | + | |
| 1524 | + | |
| 1525 | + | |
1393 | 1526 | | |
1394 | 1527 | | |
1395 | 1528 | | |
| |||
1470 | 1603 | | |
1471 | 1604 | | |
1472 | 1605 | | |
| 1606 | + | |
| 1607 | + | |
| 1608 | + | |
| 1609 | + | |
1473 | 1610 | | |
1474 | 1611 | | |
Lines changed: 24 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
| |||
143 | 144 | | |
144 | 145 | | |
145 | 146 | | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
146 | 170 | | |
147 | 171 | | |
148 | 172 | | |
| |||
0 commit comments