Summary
GroupRef is a bare string while every other cross-CRD reference in the API uses a typed struct. This inconsistency prevents extending GroupRef with additional fields (like namespace) without a breaking change, and blocks struct-level validation markers.
Severity: MUST FIX
Area: CRD API Design
Breaking: Yes — changes wire format from groupRef: "my-group" to groupRef: {name: "my-group"}
Location
cmd/thv-operator/api/v1alpha1/mcpserver_types.go:295
cmd/thv-operator/api/v1alpha1/mcpremoteproxy_types.go:130
Problem
GroupRef string `json:"groupRef,omitempty"`
Every other cross-CRD reference uses a typed struct:
ExternalAuthConfigRef struct { Name string }
ToolConfigRef struct { Name string }
MCPOIDCConfigReference struct { Name, Audience, Scopes }
EmbeddingServerRef struct { Name string }
GroupRef is the only one using a bare string.
Impact
- Inconsistent API pattern
- Cannot add fields like
namespace to GroupRef without a breaking change
- No struct-level validation markers possible
Recommended Fix
- Define
type MCPGroupRef struct { Name string +""+json:"name"+""+ }
- Replace
GroupRef string with GroupRef *MCPGroupRef on MCPServerSpec and MCPRemoteProxySpec
- Update controller code to access
GroupRef.Name instead of GroupRef directly
- This is a breaking wire-format change (from string to object) — must happen before v1beta1
Summary
GroupRefis a barestringwhile every other cross-CRD reference in the API uses a typed struct. This inconsistency prevents extending GroupRef with additional fields (like namespace) without a breaking change, and blocks struct-level validation markers.Severity: MUST FIX
Area: CRD API Design
Breaking: Yes — changes wire format from
groupRef: "my-group"togroupRef: {name: "my-group"}Location
cmd/thv-operator/api/v1alpha1/mcpserver_types.go:295cmd/thv-operator/api/v1alpha1/mcpremoteproxy_types.go:130Problem
Every other cross-CRD reference uses a typed struct:
ExternalAuthConfigRef struct { Name string }ToolConfigRef struct { Name string }MCPOIDCConfigReference struct { Name, Audience, Scopes }EmbeddingServerRef struct { Name string }GroupRefis the only one using a bare string.Impact
namespaceto GroupRef without a breaking changeRecommended Fix
type MCPGroupRef struct { Name string+""+json:"name"+""+}GroupRef stringwithGroupRef *MCPGroupRefon MCPServerSpec and MCPRemoteProxySpecGroupRef.Nameinstead ofGroupRefdirectly