Documentation
¶
Overview ¶
Package vmcpconfig provides conversion logic from VirtualMCPServer CRD to vmcp Config
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Converter ¶
type Converter struct {
// contains filtered or unexported fields
}
Converter converts VirtualMCPServer CRD specs to vmcp Config
func NewConverter ¶
NewConverter creates a new Converter instance. oidcResolver is required and used to resolve OIDC configuration from various sources (kubernetes, configMap, inline). Use a mock resolver in tests. k8sClient is required for resolving MCPToolConfig references and fetching referenced VirtualMCPCompositeToolDefinition resources. Returns an error if oidcResolver or k8sClient is nil.
func (*Converter) Convert ¶
func (c *Converter) Convert( ctx context.Context, vmcp *mcpv1alpha1.VirtualMCPServer, ) (*vmcpconfig.Config, error)
Convert converts VirtualMCPServer CRD spec to vmcp Config.
The conversion starts with a DeepCopy of the embedded config.Config from the CRD spec. This ensures that simple fields (like Optimizer, Metadata, etc.) are automatically passed through without explicit mapping. Only fields that require special handling (auth, aggregation, composite tools, telemetry) are explicitly converted below.