Repository navigation
Closed
Labels
apiItems related to the APIenhancementNew feature or requestgoPull requests that update go codekubernetesItems related to Kubernetesoperator
Description
Summary
RFC-0023 specifies a structured referencingWorkloads list with kind and name fields on shared configuration CRD status, rather than plain []string. PR #4483 migrated MCPOIDCConfig to the new WorkloadReference type. The same migration is needed for the remaining three CRDs.
CRDs to migrate
| CRD | File | Current field |
|---|---|---|
| MCPToolConfig | cmd/thv-operator/api/v1alpha1/toolconfig_types.go:80-83 |
ReferencingServers []string |
| MCPExternalAuthConfig | cmd/thv-operator/api/v1alpha1/mcpexternalauthconfig_types.go:715-718 |
ReferencingServers []string |
| MCPTelemetryConfig | cmd/thv-operator/api/v1alpha1/mcptelemetryconfig_types.go:62-64 |
ReferencingServers []string |
Target state
Each CRD should use the WorkloadReference type (already defined in mcpoidcconfig_types.go):
type WorkloadReference struct {
Kind string `json:"kind"` // MCPServer, VirtualMCPServer, MCPRemoteProxy
Name string `json:"name"`
}Field rename: ReferencingServers []string → ReferencingWorkloads []WorkloadReference
Controllers to update
For each CRD, the corresponding controller builds and compares the referencing list:
- ToolConfigReconciler (
toolconfig_controller.go) —updateReferencingServers()method - MCPExternalAuthConfigReconciler (
mcpexternalauthconfig_controller.go) —updateReferencingServers()method - MCPTelemetryConfigReconciler — equivalent method
Each needs to build WorkloadReference structs with explicit Kind instead of plain server name strings.
Pattern to follow
See the MCPOIDCConfig migration in PR #4483 for the exact pattern:
findReferencingServers→findReferencingWorkloadsreturning[]WorkloadReference- Watch handlers compare
ref.Kind == "MCPServer" && ref.Name == server.Nameinstead ofref == server.Name - Deletion protection message uses
"ReferencedByWorkloads"reason
Notes
- This is a breaking change to the CRD status schema (status fields are not part of the API contract for clients, but tooling that reads status will need updates)
- The
WorkloadReferencetype is shared — defined once inmcpoidcconfig_types.go, reusable by all CRDs - CRD manifests, deepcopy, and API docs need regeneration after the change
Metadata
Metadata
Assignees
Labels
apiItems related to the APIenhancementNew feature or requestgoPull requests that update go codekubernetesItems related to Kubernetesoperator
Activity
Replace ReferencingServers with structured ReferencingWorkloads on MC…
Replace ReferencingServers with structured ReferencingWorkloads on MC…
Replace ReferencingServers with structured ReferencingWorkloads on MC…
Replace ReferencingServers with structured ReferencingWorkloads on MC…
Replace ReferencingServers with structured ReferencingWorkloads on MC…
Replace ReferencingServers with structured ReferencingWorkloads on MC…
Replace ReferencingServers with structured ReferencingWorkloads on MC…
Handle stale ReferencingWorkloads in telemetry watch
Replace ReferencingServers with structured ReferencingWorkloads on MC…
Replace ReferencingServers with structured ReferencingWorkloads on MC…
Replace ReferencingServers with ReferencingWorkloads on MCPExternalAu…
Handle stale ReferencingWorkloads in telemetry watch handler (#4508)
Replace ReferencingServers with ReferencingWorkloads on MCPToolConfig (…
Replace ReferencingServers with ReferencingWorkloads on MCPToolConfig (…
Replace ReferencingServers with ReferencingWorkloads on MCPExternalAu…
Handle stale ReferencingWorkloads in telemetry watch handler (stacklo…