Documentation
¶
Index ¶
- type MockClusterManager
- func (m *MockClusterManager) GetClient(clusterName string) (kubernetes.Interface, error)
- func (m *MockClusterManager) GetCurrentClient() (kubernetes.Interface, error)
- func (m *MockClusterManager) GetCurrentContext() string
- func (m *MockClusterManager) GetCurrentDynamicClient() (dynamic.Interface, error)
- func (m *MockClusterManager) GetCurrentNamespace() string
- func (m *MockClusterManager) GetDynamicClient(clusterName string) (dynamic.Interface, error)
- func (m *MockClusterManager) ListClusters() []string
- func (m *MockClusterManager) LoadKubeConfig(name, path string) error
- func (m *MockClusterManager) SetCurrentContext(contextName string) error
- func (m *MockClusterManager) SetCurrentNamespace(namespace string)
- type MockDeployment
- type MockDeploymentFactory
- type MockPod
- func (m *MockPod) Create(ctx context.Context, cm kai.ClusterManager) (string, error)
- func (m *MockPod) Delete(ctx context.Context, cm kai.ClusterManager, force bool) (string, error)
- func (m *MockPod) Get(ctx context.Context, cm kai.ClusterManager) (string, error)
- func (m *MockPod) List(ctx context.Context, cm kai.ClusterManager, limit int64, ...) (string, error)
- func (m *MockPod) StreamLogs(ctx context.Context, cm kai.ClusterManager, tailLines int64, previous bool, ...) (string, error)
- type MockPodFactory
- type MockServer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MockClusterManager ¶
MockClusterManager implements the ClusterManager interface for testing
func NewMockClusterManager ¶
func NewMockClusterManager() *MockClusterManager
NewMockClusterManager initializes with defaults similar to the real implementation
func (*MockClusterManager) GetClient ¶
func (m *MockClusterManager) GetClient(clusterName string) (kubernetes.Interface, error)
func (*MockClusterManager) GetCurrentClient ¶
func (m *MockClusterManager) GetCurrentClient() (kubernetes.Interface, error)
func (*MockClusterManager) GetCurrentContext ¶
func (m *MockClusterManager) GetCurrentContext() string
func (*MockClusterManager) GetCurrentDynamicClient ¶
func (m *MockClusterManager) GetCurrentDynamicClient() (dynamic.Interface, error)
func (*MockClusterManager) GetCurrentNamespace ¶
func (m *MockClusterManager) GetCurrentNamespace() string
func (*MockClusterManager) GetDynamicClient ¶
func (m *MockClusterManager) GetDynamicClient(clusterName string) (dynamic.Interface, error)
func (*MockClusterManager) ListClusters ¶
func (m *MockClusterManager) ListClusters() []string
func (*MockClusterManager) LoadKubeConfig ¶
func (m *MockClusterManager) LoadKubeConfig(name, path string) error
func (*MockClusterManager) SetCurrentContext ¶
func (m *MockClusterManager) SetCurrentContext(contextName string) error
func (*MockClusterManager) SetCurrentNamespace ¶
func (m *MockClusterManager) SetCurrentNamespace(namespace string)
type MockDeployment ¶
type MockDeployment struct {
mock.Mock
Name string
Namespace string
Image string
Replicas float64
Labels map[string]interface{}
ContainerPort string
Env map[string]interface{}
ImagePullPolicy string
ImagePullSecrets []interface{}
}
MockDeployment implements the kai.DeploymentOperator interface
func NewMockDeployment ¶
func NewMockDeployment(params kai.DeploymentParams) *MockDeployment
NewMockDeployment creates a new MockDeployment
func (*MockDeployment) Create ¶
func (m *MockDeployment) Create(ctx context.Context, cm kai.ClusterManager) (string, error)
Create mocks the Create method
type MockDeploymentFactory ¶
MockDeploymentFactory implements the tools.DeploymentFactory interface
func NewMockDeploymentFactory ¶
func NewMockDeploymentFactory() *MockDeploymentFactory
NewMockDeploymentFactory creates a new MockDeploymentFactory
func (*MockDeploymentFactory) NewDeployment ¶
func (m *MockDeploymentFactory) NewDeployment(params kai.DeploymentParams) kai.DeploymentOperator
NewDeployment returns a mocked DeploymentOperator
type MockPod ¶
type MockPod struct {
mock.Mock
Name string
Namespace string
Image string
Command []interface{}
Args []interface{}
Labels map[string]interface{}
ContainerName string
ContainerPort string
Env map[string]interface{}
ImagePullPolicy string
ImagePullSecrets []interface{}
RestartPolicy string
NodeSelector map[string]interface{}
ServiceAccountName string
Volumes []interface{}
VolumeMounts []interface{}
}
MockPod implements the PodOperator interface for testing
func NewMockPod ¶
NewMockPod creates a new MockPod instance
type MockPodFactory ¶
MockPodFactory implements the PodFactory interface for testing
func (*MockPodFactory) NewPod ¶
func (m *MockPodFactory) NewPod(params kai.PodParams) kai.PodOperator
NewPod returns a mocked PodOperator
type MockServer ¶
MockServer to check that each respective tool is registered correctly
func (*MockServer) AddTool ¶
func (m *MockServer) AddTool(tool mcp.Tool, handler server.ToolHandlerFunc)
func (*MockServer) Serve ¶
func (m *MockServer) Serve() error