Documentation
¶
Index ¶
- Constants
- func ConfigMapName(proxyName string) string
- func ServiceAccountName(proxyName string) string
- func ServiceName(proxyName string) string
- type MCPRemoteProxyTestHelper
- func (h *MCPRemoteProxyTestHelper) CleanupRemoteProxies() error
- func (h *MCPRemoteProxyTestHelper) GetRemoteProxy(name string) (*mcpv1alpha1.MCPRemoteProxy, error)
- func (h *MCPRemoteProxyTestHelper) GetRemoteProxyCondition(name, conditionType string) (*metav1.Condition, error)
- func (h *MCPRemoteProxyTestHelper) GetRemoteProxyPhase(name string) (mcpv1alpha1.MCPRemoteProxyPhase, error)
- func (h *MCPRemoteProxyTestHelper) GetRemoteProxyStatus(name string) (*mcpv1alpha1.MCPRemoteProxyStatus, error)
- func (h *MCPRemoteProxyTestHelper) NewRemoteProxyBuilder(name string) *RemoteProxyBuilder
- func (h *MCPRemoteProxyTestHelper) WaitForConfigMap(name string, timeout time.Duration) *corev1.ConfigMap
- func (h *MCPRemoteProxyTestHelper) WaitForDeployment(name string, timeout time.Duration) *appsv1.Deployment
- func (h *MCPRemoteProxyTestHelper) WaitForRole(name string, timeout time.Duration) *rbacv1.Role
- func (h *MCPRemoteProxyTestHelper) WaitForRoleBinding(name string, timeout time.Duration) *rbacv1.RoleBinding
- func (h *MCPRemoteProxyTestHelper) WaitForService(name string, timeout time.Duration) *corev1.Service
- func (h *MCPRemoteProxyTestHelper) WaitForServiceAccount(name string, timeout time.Duration) *corev1.ServiceAccount
- type RemoteProxyBuilder
- type RemoteProxyStatusTestHelper
- func (h *RemoteProxyStatusTestHelper) WaitForCondition(proxyName, conditionType string, expectedStatus metav1.ConditionStatus, ...)
- func (h *RemoteProxyStatusTestHelper) WaitForConditionReason(proxyName, conditionType, expectedReason string, timeout time.Duration)
- func (h *RemoteProxyStatusTestHelper) WaitForPhase(proxyName string, expectedPhase mcpv1alpha1.MCPRemoteProxyPhase, ...)
- func (h *RemoteProxyStatusTestHelper) WaitForPhaseAny(proxyName string, expectedPhases []mcpv1alpha1.MCPRemoteProxyPhase, ...)
- func (h *RemoteProxyStatusTestHelper) WaitForURL(proxyName string, timeout time.Duration)
Constants ¶
const ( // MediumTimeout for operations that may take some time (e.g., controller reconciliation) MediumTimeout = 30 * time.Second // LongTimeout for operations that may take a while (e.g., sync operations) LongTimeout = 2 * time.Minute // DefaultPollingInterval for Eventually/Consistently checks DefaultPollingInterval = 1 * time.Second )
Common timeout values for different types of operations
Variables ¶
This section is empty.
Functions ¶
func ConfigMapName ¶ added in v0.9.3
ConfigMapName returns the expected RunConfig ConfigMap name for an MCPRemoteProxy, mirroring the controller's naming convention.
func ServiceAccountName ¶ added in v0.9.3
ServiceAccountName returns the expected ServiceAccount name for an MCPRemoteProxy, mirroring the controller's naming convention.
func ServiceName ¶ added in v0.9.3
ServiceName returns the expected Service name for an MCPRemoteProxy, mirroring the controller's naming convention.
Types ¶
type MCPRemoteProxyTestHelper ¶
type MCPRemoteProxyTestHelper struct {
Client client.Client
Context context.Context
Namespace string
}
MCPRemoteProxyTestHelper provides specialized utilities for MCPRemoteProxy testing
func NewMCPRemoteProxyTestHelper ¶
func NewMCPRemoteProxyTestHelper( ctx context.Context, k8sClient client.Client, namespace string, ) *MCPRemoteProxyTestHelper
NewMCPRemoteProxyTestHelper creates a new test helper for MCPRemoteProxy operations
func (*MCPRemoteProxyTestHelper) CleanupRemoteProxies ¶
func (h *MCPRemoteProxyTestHelper) CleanupRemoteProxies() error
CleanupRemoteProxies deletes all MCPRemoteProxies in the namespace
func (*MCPRemoteProxyTestHelper) GetRemoteProxy ¶
func (h *MCPRemoteProxyTestHelper) GetRemoteProxy(name string) (*mcpv1alpha1.MCPRemoteProxy, error)
GetRemoteProxy retrieves an MCPRemoteProxy by name
func (*MCPRemoteProxyTestHelper) GetRemoteProxyCondition ¶
func (h *MCPRemoteProxyTestHelper) GetRemoteProxyCondition( name, conditionType string, ) (*metav1.Condition, error)
GetRemoteProxyCondition returns a specific condition from the proxy status
func (*MCPRemoteProxyTestHelper) GetRemoteProxyPhase ¶
func (h *MCPRemoteProxyTestHelper) GetRemoteProxyPhase( name string, ) (mcpv1alpha1.MCPRemoteProxyPhase, error)
GetRemoteProxyPhase returns the current phase of an MCPRemoteProxy
func (*MCPRemoteProxyTestHelper) GetRemoteProxyStatus ¶
func (h *MCPRemoteProxyTestHelper) GetRemoteProxyStatus( name string, ) (*mcpv1alpha1.MCPRemoteProxyStatus, error)
GetRemoteProxyStatus returns the current status of an MCPRemoteProxy
func (*MCPRemoteProxyTestHelper) NewRemoteProxyBuilder ¶
func (h *MCPRemoteProxyTestHelper) NewRemoteProxyBuilder(name string) *RemoteProxyBuilder
NewRemoteProxyBuilder creates a new MCPRemoteProxy builder with sensible defaults for required fields (RemoteURL, OIDCConfig) so tests only need to override what they're testing
func (*MCPRemoteProxyTestHelper) WaitForConfigMap ¶ added in v0.9.3
func (h *MCPRemoteProxyTestHelper) WaitForConfigMap(name string, timeout time.Duration) *corev1.ConfigMap
WaitForConfigMap waits for a ConfigMap to be created and returns it.
func (*MCPRemoteProxyTestHelper) WaitForDeployment ¶ added in v0.9.3
func (h *MCPRemoteProxyTestHelper) WaitForDeployment(name string, timeout time.Duration) *appsv1.Deployment
WaitForDeployment waits for a Deployment to be created and returns it.
func (*MCPRemoteProxyTestHelper) WaitForRole ¶ added in v0.9.3
WaitForRole waits for a Role to be created and returns it.
func (*MCPRemoteProxyTestHelper) WaitForRoleBinding ¶ added in v0.9.3
func (h *MCPRemoteProxyTestHelper) WaitForRoleBinding(name string, timeout time.Duration) *rbacv1.RoleBinding
WaitForRoleBinding waits for a RoleBinding to be created and returns it.
func (*MCPRemoteProxyTestHelper) WaitForService ¶ added in v0.9.3
func (h *MCPRemoteProxyTestHelper) WaitForService(name string, timeout time.Duration) *corev1.Service
WaitForService waits for a Service to be created and returns it.
func (*MCPRemoteProxyTestHelper) WaitForServiceAccount ¶ added in v0.9.3
func (h *MCPRemoteProxyTestHelper) WaitForServiceAccount(name string, timeout time.Duration) *corev1.ServiceAccount
WaitForServiceAccount waits for a ServiceAccount to be created and returns it.
type RemoteProxyBuilder ¶
type RemoteProxyBuilder struct {
// contains filtered or unexported fields
}
RemoteProxyBuilder provides a fluent interface for building MCPRemoteProxy objects
func (*RemoteProxyBuilder) Create ¶
func (rb *RemoteProxyBuilder) Create(h *MCPRemoteProxyTestHelper) *mcpv1alpha1.MCPRemoteProxy
Create builds and creates the MCPRemoteProxy in the cluster
func (*RemoteProxyBuilder) WithPort ¶
func (rb *RemoteProxyBuilder) WithPort(port int32) *RemoteProxyBuilder
WithPort sets the port for the proxy
type RemoteProxyStatusTestHelper ¶
type RemoteProxyStatusTestHelper struct {
// contains filtered or unexported fields
}
RemoteProxyStatusTestHelper provides utilities for MCPRemoteProxy status testing and validation
func NewRemoteProxyStatusTestHelper ¶
func NewRemoteProxyStatusTestHelper( proxyHelper *MCPRemoteProxyTestHelper, ) *RemoteProxyStatusTestHelper
NewRemoteProxyStatusTestHelper creates a new test helper for status operations
func (*RemoteProxyStatusTestHelper) WaitForCondition ¶ added in v0.9.3
func (h *RemoteProxyStatusTestHelper) WaitForCondition( proxyName, conditionType string, expectedStatus metav1.ConditionStatus, timeout time.Duration, )
WaitForCondition waits for a specific condition to have the expected status
func (*RemoteProxyStatusTestHelper) WaitForConditionReason ¶ added in v0.9.3
func (h *RemoteProxyStatusTestHelper) WaitForConditionReason( proxyName, conditionType, expectedReason string, timeout time.Duration, )
WaitForConditionReason waits for a condition to have a specific reason
func (*RemoteProxyStatusTestHelper) WaitForPhase ¶ added in v0.9.3
func (h *RemoteProxyStatusTestHelper) WaitForPhase( proxyName string, expectedPhase mcpv1alpha1.MCPRemoteProxyPhase, timeout time.Duration, )
WaitForPhase waits for an MCPRemoteProxy to reach the specified phase
func (*RemoteProxyStatusTestHelper) WaitForPhaseAny ¶
func (h *RemoteProxyStatusTestHelper) WaitForPhaseAny( proxyName string, expectedPhases []mcpv1alpha1.MCPRemoteProxyPhase, timeout time.Duration, )
WaitForPhaseAny waits for an MCPRemoteProxy to reach any of the specified phases
func (*RemoteProxyStatusTestHelper) WaitForURL ¶
func (h *RemoteProxyStatusTestHelper) WaitForURL(proxyName string, timeout time.Duration)
WaitForURL waits for the URL to be set in the status