Documentation
¶
Index ¶
- Constants
- func CleanupMockServer(ctx context.Context, c client.Client, ...)
- func DeployInstrumentedBackendServer(ctx context.Context, c client.Client, namespace, serverName string)
- func DeployMockOIDCServerHTTP(ctx context.Context, c client.Client, namespace, serverName string)
- func GetInstrumentedBackendStats(ctx context.Context, c client.Client, namespace, serviceName string) (map[string]int, error)
- func GetMCPGroupBackends(ctx context.Context, c client.Client, groupName, namespace string) ([]mcpv1alpha1.MCPServer, error)
- func GetMockOIDCStats(ctx context.Context, c client.Client, namespace, serviceName string) (map[string]int, error)
- func GetPodLogsForDeployment(ctx context.Context, c client.Client, namespace, deploymentName string) string
- func GetServiceStats(ctx context.Context, c client.Client, namespace, serviceName string, port int) (string, error)
- func GetVirtualMCPServerPods(ctx context.Context, c client.Client, vmcpServerName, namespace string) (*corev1.PodList, error)
- func GetVirtualMCPServerStatus(ctx context.Context, c client.Client, name, namespace string) (*mcpv1alpha1.VirtualMCPServerStatus, error)
- func HasCondition(vmcpServer *mcpv1alpha1.VirtualMCPServer, conditionType string, ...) bool
- func WaitForCondition(ctx context.Context, c client.Client, name, namespace string, ...)
- func WaitForPodsReady(ctx context.Context, c client.Client, namespace string, ...)
- func WaitForVirtualMCPServerReady(ctx context.Context, c client.Client, name, namespace string, ...)
- type InitializedMCPClient
Constants ¶
const InstrumentedBackendScript = `` /* 1379-byte string literal not displayed */
InstrumentedBackendScript is an instrumented backend script that tracks Bearer tokens
const MockOIDCServerHTTPScript = `` /* 1627-byte string literal not displayed */
MockOIDCServerHTTPScript is a mock OIDC server script with HTTP (for testing with private IPs)
Variables ¶
This section is empty.
Functions ¶
func CleanupMockServer ¶
func CleanupMockServer(ctx context.Context, c client.Client, namespace, serverName, tlsSecretName string)
CleanupMockServer cleans up a mock server deployment, service, and optionally its TLS secret
func DeployInstrumentedBackendServer ¶
func DeployInstrumentedBackendServer(ctx context.Context, c client.Client, namespace, serverName string)
DeployInstrumentedBackendServer deploys a backend server that logs all headers
func DeployMockOIDCServerHTTP ¶
DeployMockOIDCServerHTTP deploys a mock OIDC server with HTTP (for testing)
func GetInstrumentedBackendStats ¶
func GetInstrumentedBackendStats(ctx context.Context, c client.Client, namespace, serviceName string) (map[string]int, error)
GetInstrumentedBackendStats queries the /stats endpoint of the instrumented backend
func GetMCPGroupBackends ¶
func GetMCPGroupBackends(ctx context.Context, c client.Client, groupName, namespace string) ([]mcpv1alpha1.MCPServer, error)
GetMCPGroupBackends returns the list of backend MCPServers in an MCPGroup Note: MCPGroup status contains the list of servers in the group
func GetMockOIDCStats ¶
func GetMockOIDCStats(ctx context.Context, c client.Client, namespace, serviceName string) (map[string]int, error)
GetMockOIDCStats queries the /stats endpoint of the mock OIDC server
func GetPodLogsForDeployment ¶
func GetPodLogsForDeployment(ctx context.Context, c client.Client, namespace, deploymentName string) string
GetPodLogsForDeployment returns logs from pods for a deployment (for debugging)
func GetServiceStats ¶
func GetServiceStats(ctx context.Context, c client.Client, namespace, serviceName string, port int) (string, error)
GetServiceStats queries the /stats endpoint of a service and returns the stats
func GetVirtualMCPServerPods ¶
func GetVirtualMCPServerPods(ctx context.Context, c client.Client, vmcpServerName, namespace string) (*corev1.PodList, error)
GetVirtualMCPServerPods returns all pods for a VirtualMCPServer
func GetVirtualMCPServerStatus ¶
func GetVirtualMCPServerStatus( ctx context.Context, c client.Client, name, namespace string, ) (*mcpv1alpha1.VirtualMCPServerStatus, error)
GetVirtualMCPServerStatus returns the current status of a VirtualMCPServer
func HasCondition ¶
func HasCondition(vmcpServer *mcpv1alpha1.VirtualMCPServer, conditionType string, expectedStatus string) bool
HasCondition checks if a VirtualMCPServer has a specific condition type with expected status
func WaitForCondition ¶
func WaitForCondition( ctx context.Context, c client.Client, name, namespace string, conditionType string, expectedStatus string, timeout time.Duration, )
WaitForCondition waits for a VirtualMCPServer to have a specific condition
Types ¶
type InitializedMCPClient ¶ added in v0.6.9
type InitializedMCPClient struct {
Client *mcpclient.Client
Ctx context.Context
Cancel context.CancelFunc
}
InitializedMCPClient holds an initialized MCP client with its associated context
func CreateInitializedMCPClient ¶ added in v0.6.9
func CreateInitializedMCPClient(nodePort int32, clientName string, timeout time.Duration) (*InitializedMCPClient, error)
CreateInitializedMCPClient creates an MCP client, starts the transport, and initializes the connection with the given client name. Returns an InitializedMCPClient that should be closed when done using defer client.Close().
func (*InitializedMCPClient) Close ¶ added in v0.6.9
func (c *InitializedMCPClient) Close()
Close cleans up the MCP client resources