Handle stale ReferencingWorkloads in telemetry watch handler#4508
Merged
ChrisJBurns merged 1 commit intomainfrom Apr 3, 2026
Merged
Handle stale ReferencingWorkloads in telemetry watch handler#4508ChrisJBurns merged 1 commit intomainfrom
ChrisJBurns merged 1 commit intomainfrom
Conversation
The MCPTelemetryConfig watch handler only enqueued the currently-referenced config when an MCPServer changed. If a server removed its telemetryConfigRef, the previously-referenced config was never reconciled to clean up its stale ReferencingWorkloads entry. Update the watch handler to also enqueue any MCPTelemetryConfig that still lists the changed server in ReferencingWorkloads, matching the pattern already used by MCPOIDCConfig. Closes #4491 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4508 +/- ##
==========================================
+ Coverage 69.04% 69.09% +0.04%
==========================================
Files 502 502
Lines 51909 51922 +13
==========================================
+ Hits 35843 35873 +30
+ Misses 13279 13264 -15
+ Partials 2787 2785 -2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
jerm-dro
approved these changes
Apr 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The MCPTelemetryConfig types were already migrated to
ReferencingWorkloads []WorkloadReferencein #4487, but the watch handler inSetupWithManageronly enqueued the currently-referenced MCPTelemetryConfig when an MCPServer changed. If a server removed itstelemetryConfigRefor was deleted, the previously-referenced config was never re-reconciled, leaving stale entries inReferencingWorkloads.This updates the watch handler to also scan all MCPTelemetryConfigs in the namespace and enqueue any that still list the changed server in their
ReferencingWorkloadsstatus, matching the pattern from the MCPOIDCConfig controller (#4492).Partial fix for #4491
Type of change
Changes
mcptelemetryconfig_controller.goReferencingWorkloadsentries usingref.Kind == "MCPServer" && ref.Name == server.Namematching, with deduplication viaseenmapTest plan
go test ./cmd/thv-operator/controllers/... -run TelemetryConfig)go build ./cmd/thv-operator/...)Special notes for reviewers
The types/status migration was already done in #4487. This PR only addresses the watch handler gap that could leave stale refs when servers are deleted or stop referencing a telemetry config.
Generated with Claude Code