controllers

package
v0.9.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 9, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
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

func ConfigMapName(proxyName string) string

ConfigMapName returns the expected RunConfig ConfigMap name for an MCPRemoteProxy, mirroring the controller's naming convention.

func ServiceAccountName added in v0.9.3

func ServiceAccountName(proxyName string) string

ServiceAccountName returns the expected ServiceAccount name for an MCPRemoteProxy, mirroring the controller's naming convention.

func ServiceName added in v0.9.3

func ServiceName(proxyName string) string

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

func (h *MCPRemoteProxyTestHelper) WaitForRole(name string, timeout time.Duration) *rbacv1.Role

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

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL