kubernetes

package
v0.0.0-...-b96ae8a Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMockRuntimeEnvironment

func NewMockRuntimeEnvironment(name, namespace string) *types.RuntimeEnvironment

NewMockRuntimeEnvironment creates a mock RuntimeEnvironment with the given name

func NewMockSandbox

func NewMockSandbox(name, namespace string) *types.Sandbox

NewMockSandbox creates a mock Sandbox with the given name

func NewMockSandboxProfile

func NewMockSandboxProfile(name, namespace string) *types.SandboxProfile

NewMockSandboxProfile creates a mock SandboxProfile with the given name

func NewMockWarmPod

func NewMockWarmPod(name, namespace string) *types.WarmPod

NewMockWarmPod creates a mock WarmPod with the given name

func NewMockWarmPool

func NewMockWarmPool(name, namespace string) *types.WarmPool

NewMockWarmPool creates a mock WarmPool with the given name

Types

type MockKubernetesClient

type MockKubernetesClient struct {
	mock.Mock
	// contains filtered or unexported fields
}

MockKubernetesClient implements the KubernetesClient interface for testing

func NewMockKubernetesClient

func NewMockKubernetesClient() *MockKubernetesClient

NewMockKubernetesClient creates a new mock Kubernetes client

func (*MockKubernetesClient) Clientset

func (m *MockKubernetesClient) Clientset() kubernetes.Interface

func (*MockKubernetesClient) CoreV1

func (m *MockKubernetesClient) CoreV1() interface{}

CoreV1 returns a mock implementation of the CoreV1Interface

func (*MockKubernetesClient) DeleteFileInSandbox

func (m *MockKubernetesClient) DeleteFileInSandbox(ctx context.Context, namespace, name string, fileReq *types.FileRequest) error

func (*MockKubernetesClient) DownloadFileFromSandbox

func (m *MockKubernetesClient) DownloadFileFromSandbox(ctx context.Context, namespace, name string, fileReq *types.FileRequest) ([]byte, error)

func (*MockKubernetesClient) DynamicClient

func (m *MockKubernetesClient) DynamicClient() dynamic.Interface

DynamicClient returns the dynamic client

func (*MockKubernetesClient) ExecuteInSandbox

func (m *MockKubernetesClient) ExecuteInSandbox(ctx context.Context, namespace, name string, execReq *types.ExecutionRequest) (*types.ExecutionResult, error)

func (*MockKubernetesClient) ExecuteStreamInSandbox

func (m *MockKubernetesClient) ExecuteStreamInSandbox(ctx context.Context, namespace, name string, execReq *types.ExecutionRequest, outputCallback func(stream, content string)) (*types.ExecutionResult, error)

func (*MockKubernetesClient) Get

func (m *MockKubernetesClient) Get(ctx context.Context, name string, options interface{}) (interface{}, error)

Get returns a mock implementation of the Get method for pods

func (*MockKubernetesClient) InformerFactory

InformerFactory returns the informer factory

func (*MockKubernetesClient) ListFilesInSandbox

func (m *MockKubernetesClient) ListFilesInSandbox(ctx context.Context, namespace, name string, fileReq *types.FileRequest) (*types.FileList, error)

func (*MockKubernetesClient) LlmsafespaceV1

LlmsafespaceV1 returns a mock implementation of the LLMSafespaceV1Interface

func (*MockKubernetesClient) Pods

func (m *MockKubernetesClient) Pods(namespace string) interface{}

Pods returns a mock implementation of the PodInterface

func (*MockKubernetesClient) RESTConfig

func (m *MockKubernetesClient) RESTConfig() *rest.Config

func (*MockKubernetesClient) SetupDeleteFileInSandboxMock

func (m *MockKubernetesClient) SetupDeleteFileInSandboxMock() *mock.Call

SetupDeleteFileInSandboxMock sets up a default mock response for DeleteFileInSandbox

func (*MockKubernetesClient) SetupDownloadFileFromSandboxMock

func (m *MockKubernetesClient) SetupDownloadFileFromSandboxMock() *mock.Call

SetupDownloadFileFromSandboxMock sets up a default mock response for DownloadFileFromSandbox

func (*MockKubernetesClient) SetupExecuteInSandboxMock

func (m *MockKubernetesClient) SetupExecuteInSandboxMock(exitCode int) *mock.Call

SetupExecuteInSandboxMock sets up a default mock response for ExecuteInSandbox

func (*MockKubernetesClient) SetupExecuteStreamInSandboxMock

func (m *MockKubernetesClient) SetupExecuteStreamInSandboxMock(exitCode int) *mock.Call

SetupExecuteStreamInSandboxMock sets up a default mock response for ExecuteStreamInSandbox

func (*MockKubernetesClient) SetupListFilesInSandboxMock

func (m *MockKubernetesClient) SetupListFilesInSandboxMock() *mock.Call

SetupListFilesInSandboxMock sets up a default mock response for ListFilesInSandbox

func (*MockKubernetesClient) SetupLlmsafespaceV1Mock

func (m *MockKubernetesClient) SetupLlmsafespaceV1Mock() *mock.Call

SetupLlmsafespaceV1Mock sets up a default mock response for LlmsafespaceV1

func (*MockKubernetesClient) SetupUploadFileToSandboxMock

func (m *MockKubernetesClient) SetupUploadFileToSandboxMock(isDir bool) *mock.Call

SetupUploadFileToSandboxMock sets up a default mock response for UploadFileToSandbox

func (*MockKubernetesClient) Start

func (m *MockKubernetesClient) Start() error

func (*MockKubernetesClient) Stop

func (m *MockKubernetesClient) Stop()

func (*MockKubernetesClient) UploadFileToSandbox

func (m *MockKubernetesClient) UploadFileToSandbox(ctx context.Context, namespace, name string, fileReq *types.FileRequest) (*types.FileResult, error)

type MockLLMSafespaceV1Interface

type MockLLMSafespaceV1Interface struct {
	mock.Mock
}

MockLLMSafespaceV1Interface implements interfaces.LLMSafespaceV1Interface for testing

func NewMockLLMSafespaceV1Interface

func NewMockLLMSafespaceV1Interface() *MockLLMSafespaceV1Interface

NewMockLLMSafespaceV1Interface creates a new mock LLMSafespaceV1Interface

func (*MockLLMSafespaceV1Interface) RuntimeEnvironments

RuntimeEnvironments returns a mock implementation of the RuntimeEnvironmentInterface

func (*MockLLMSafespaceV1Interface) SandboxProfiles

SandboxProfiles returns a mock implementation of the SandboxProfileInterface

func (*MockLLMSafespaceV1Interface) Sandboxes

Sandboxes returns a mock implementation of the SandboxInterface

func (*MockLLMSafespaceV1Interface) SetupRuntimeEnvironmentsMock

func (m *MockLLMSafespaceV1Interface) SetupRuntimeEnvironmentsMock(namespace string) *MockRuntimeEnvironmentInterface

SetupRuntimeEnvironmentsMock sets up a default mock response for RuntimeEnvironments

func (*MockLLMSafespaceV1Interface) SetupSandboxProfilesMock

func (m *MockLLMSafespaceV1Interface) SetupSandboxProfilesMock(namespace string) *MockSandboxProfileInterface

SetupSandboxProfilesMock sets up a default mock response for SandboxProfiles

func (*MockLLMSafespaceV1Interface) SetupSandboxesMock

func (m *MockLLMSafespaceV1Interface) SetupSandboxesMock(namespace string) *MockSandboxInterface

SetupSandboxesMock sets up a default mock response for Sandboxes

func (*MockLLMSafespaceV1Interface) SetupWarmPodsMock

func (m *MockLLMSafespaceV1Interface) SetupWarmPodsMock(namespace string) *MockWarmPodInterface

SetupWarmPodsMock sets up a default mock response for WarmPods

func (*MockLLMSafespaceV1Interface) SetupWarmPoolsMock

func (m *MockLLMSafespaceV1Interface) SetupWarmPoolsMock(namespace string) *MockWarmPoolInterface

SetupWarmPoolsMock sets up a default mock response for WarmPools

func (*MockLLMSafespaceV1Interface) WarmPods

WarmPods returns a mock implementation of the WarmPodInterface

func (*MockLLMSafespaceV1Interface) WarmPools

WarmPools returns a mock implementation of the WarmPoolInterface

type MockRuntimeEnvironmentInterface

type MockRuntimeEnvironmentInterface struct {
	mock.Mock
}

MockRuntimeEnvironmentInterface implements the RuntimeEnvironmentInterface for testing

func NewMockRuntimeEnvironmentInterface

func NewMockRuntimeEnvironmentInterface() *MockRuntimeEnvironmentInterface

NewMockRuntimeEnvironmentInterface creates a new mock RuntimeEnvironmentInterface

func (*MockRuntimeEnvironmentInterface) Create

func (*MockRuntimeEnvironmentInterface) Delete

func (*MockRuntimeEnvironmentInterface) Get

func (*MockRuntimeEnvironmentInterface) List

func (*MockRuntimeEnvironmentInterface) SetupCreateMock

func (m *MockRuntimeEnvironmentInterface) SetupCreateMock() *mock.Call

SetupCreateMock sets up a default mock response for Create

func (*MockRuntimeEnvironmentInterface) SetupDeleteMock

func (m *MockRuntimeEnvironmentInterface) SetupDeleteMock() *mock.Call

SetupDeleteMock sets up a default mock response for Delete

func (*MockRuntimeEnvironmentInterface) SetupGetMock

func (m *MockRuntimeEnvironmentInterface) SetupGetMock(name string) *mock.Call

SetupGetMock sets up a default mock response for Get

func (*MockRuntimeEnvironmentInterface) SetupListMock

func (m *MockRuntimeEnvironmentInterface) SetupListMock() *mock.Call

SetupListMock sets up a default mock response for List

func (*MockRuntimeEnvironmentInterface) SetupUpdateMock

func (m *MockRuntimeEnvironmentInterface) SetupUpdateMock() *mock.Call

SetupUpdateMock sets up a default mock response for Update

func (*MockRuntimeEnvironmentInterface) SetupUpdateStatusMock

func (m *MockRuntimeEnvironmentInterface) SetupUpdateStatusMock() *mock.Call

SetupUpdateStatusMock sets up a default mock response for UpdateStatus

func (*MockRuntimeEnvironmentInterface) SetupWatchMock

func (m *MockRuntimeEnvironmentInterface) SetupWatchMock() *mock.Call

SetupWatchMock sets up a mock response for Watch with any ListOptions

func (*MockRuntimeEnvironmentInterface) Update

func (*MockRuntimeEnvironmentInterface) UpdateStatus

func (*MockRuntimeEnvironmentInterface) Watch

type MockSandboxInterface

type MockSandboxInterface struct {
	mock.Mock
}

MockSandboxInterface implements the SandboxInterface for testing

func NewMockSandboxInterface

func NewMockSandboxInterface() *MockSandboxInterface

NewMockSandboxInterface creates a new mock SandboxInterface

func (*MockSandboxInterface) Create

func (m *MockSandboxInterface) Create(sandbox *types.Sandbox) (*types.Sandbox, error)

func (*MockSandboxInterface) Delete

func (m *MockSandboxInterface) Delete(name string, options metav1.DeleteOptions) error

func (*MockSandboxInterface) Get

func (m *MockSandboxInterface) Get(name string, options metav1.GetOptions) (*types.Sandbox, error)

func (*MockSandboxInterface) List

func (*MockSandboxInterface) SetupCreateMock

func (m *MockSandboxInterface) SetupCreateMock() *mock.Call

SetupCreateMock sets up a default mock response for Create

func (*MockSandboxInterface) SetupDeleteMock

func (m *MockSandboxInterface) SetupDeleteMock() *mock.Call

SetupDeleteMock sets up a default mock response for Delete

func (*MockSandboxInterface) SetupGetMock

func (m *MockSandboxInterface) SetupGetMock(name string) *mock.Call

SetupGetMock sets up a default mock response for Get

func (*MockSandboxInterface) SetupListMock

func (m *MockSandboxInterface) SetupListMock() *mock.Call

SetupListMock sets up a default mock response for List

func (*MockSandboxInterface) SetupUpdateMock

func (m *MockSandboxInterface) SetupUpdateMock() *mock.Call

SetupUpdateMock sets up a default mock response for Update

func (*MockSandboxInterface) SetupUpdateStatusMock

func (m *MockSandboxInterface) SetupUpdateStatusMock() *mock.Call

SetupUpdateStatusMock sets up a default mock response for UpdateStatus

func (*MockSandboxInterface) SetupWatchMock

func (m *MockSandboxInterface) SetupWatchMock() *mock.Call

SetupWatchMock sets up a mock response for Watch with any ListOptions

func (*MockSandboxInterface) Update

func (m *MockSandboxInterface) Update(sandbox *types.Sandbox) (*types.Sandbox, error)

func (*MockSandboxInterface) UpdateStatus

func (m *MockSandboxInterface) UpdateStatus(sandbox *types.Sandbox) (*types.Sandbox, error)

func (*MockSandboxInterface) Watch

type MockSandboxProfileInterface

type MockSandboxProfileInterface struct {
	mock.Mock
}

MockSandboxProfileInterface implements the SandboxProfileInterface for testing

func NewMockSandboxProfileInterface

func NewMockSandboxProfileInterface() *MockSandboxProfileInterface

NewMockSandboxProfileInterface creates a new mock SandboxProfileInterface

func (*MockSandboxProfileInterface) Create

func (*MockSandboxProfileInterface) Delete

func (m *MockSandboxProfileInterface) Delete(name string, options metav1.DeleteOptions) error

func (*MockSandboxProfileInterface) Get

func (*MockSandboxProfileInterface) List

func (*MockSandboxProfileInterface) SetupCreateMock

func (m *MockSandboxProfileInterface) SetupCreateMock() *mock.Call

SetupCreateMock sets up a default mock response for Create

func (*MockSandboxProfileInterface) SetupDeleteMock

func (m *MockSandboxProfileInterface) SetupDeleteMock() *mock.Call

SetupDeleteMock sets up a default mock response for Delete

func (*MockSandboxProfileInterface) SetupGetMock

func (m *MockSandboxProfileInterface) SetupGetMock(name string) *mock.Call

SetupGetMock sets up a default mock response for Get

func (*MockSandboxProfileInterface) SetupListMock

func (m *MockSandboxProfileInterface) SetupListMock() *mock.Call

SetupListMock sets up a default mock response for List

func (*MockSandboxProfileInterface) SetupUpdateMock

func (m *MockSandboxProfileInterface) SetupUpdateMock() *mock.Call

SetupUpdateMock sets up a default mock response for Update

func (*MockSandboxProfileInterface) SetupWatchMock

func (m *MockSandboxProfileInterface) SetupWatchMock() *mock.Call

SetupWatchMock sets up a mock response for Watch with any ListOptions

func (*MockSandboxProfileInterface) Update

func (*MockSandboxProfileInterface) Watch

type MockWarmPodInterface

type MockWarmPodInterface struct {
	mock.Mock
}

MockWarmPodInterface implements the WarmPodInterface for testing

func NewMockWarmPodInterface

func NewMockWarmPodInterface() *MockWarmPodInterface

NewMockWarmPodInterface creates a new mock WarmPodInterface

func (*MockWarmPodInterface) Create

func (m *MockWarmPodInterface) Create(warmPod *types.WarmPod) (*types.WarmPod, error)

func (*MockWarmPodInterface) Delete

func (m *MockWarmPodInterface) Delete(name string, options metav1.DeleteOptions) error

func (*MockWarmPodInterface) Get

func (m *MockWarmPodInterface) Get(name string, options metav1.GetOptions) (*types.WarmPod, error)

func (*MockWarmPodInterface) List

func (*MockWarmPodInterface) SetupCreateMock

func (m *MockWarmPodInterface) SetupCreateMock() *mock.Call

SetupCreateMock sets up a default mock response for Create

func (*MockWarmPodInterface) SetupDeleteMock

func (m *MockWarmPodInterface) SetupDeleteMock() *mock.Call

SetupDeleteMock sets up a default mock response for Delete

func (*MockWarmPodInterface) SetupGetMock

func (m *MockWarmPodInterface) SetupGetMock(name string) *mock.Call

SetupGetMock sets up a default mock response for Get

func (*MockWarmPodInterface) SetupListMock

func (m *MockWarmPodInterface) SetupListMock() *mock.Call

SetupListMock sets up a default mock response for List

func (*MockWarmPodInterface) SetupUpdateMock

func (m *MockWarmPodInterface) SetupUpdateMock() *mock.Call

SetupUpdateMock sets up a default mock response for Update

func (*MockWarmPodInterface) SetupUpdateStatusMock

func (m *MockWarmPodInterface) SetupUpdateStatusMock() *mock.Call

SetupUpdateStatusMock sets up a default mock response for UpdateStatus

func (*MockWarmPodInterface) SetupWatchMock

func (m *MockWarmPodInterface) SetupWatchMock() *mock.Call

SetupWatchMock sets up a mock response for Watch with any ListOptions

func (*MockWarmPodInterface) Update

func (m *MockWarmPodInterface) Update(warmPod *types.WarmPod) (*types.WarmPod, error)

func (*MockWarmPodInterface) UpdateStatus

func (m *MockWarmPodInterface) UpdateStatus(warmPod *types.WarmPod) (*types.WarmPod, error)

func (*MockWarmPodInterface) Watch

type MockWarmPoolInterface

type MockWarmPoolInterface struct {
	mock.Mock
}

MockWarmPoolInterface implements the WarmPoolInterface for testing

func NewMockWarmPoolInterface

func NewMockWarmPoolInterface() *MockWarmPoolInterface

NewMockWarmPoolInterface creates a new mock WarmPoolInterface

func (*MockWarmPoolInterface) Create

func (m *MockWarmPoolInterface) Create(warmPool *types.WarmPool) (*types.WarmPool, error)

func (*MockWarmPoolInterface) Delete

func (m *MockWarmPoolInterface) Delete(name string, options metav1.DeleteOptions) error

func (*MockWarmPoolInterface) Get

func (m *MockWarmPoolInterface) Get(name string, options metav1.GetOptions) (*types.WarmPool, error)

func (*MockWarmPoolInterface) List

func (*MockWarmPoolInterface) SetupCreateMock

func (m *MockWarmPoolInterface) SetupCreateMock() *mock.Call

SetupCreateMock sets up a default mock response for Create

func (*MockWarmPoolInterface) SetupDeleteMock

func (m *MockWarmPoolInterface) SetupDeleteMock() *mock.Call

SetupDeleteMock sets up a default mock response for Delete

func (*MockWarmPoolInterface) SetupGetMock

func (m *MockWarmPoolInterface) SetupGetMock(name string) *mock.Call

SetupGetMock sets up a default mock response for Get

func (*MockWarmPoolInterface) SetupListMock

func (m *MockWarmPoolInterface) SetupListMock() *mock.Call

SetupListMock sets up a default mock response for List

func (*MockWarmPoolInterface) SetupUpdateMock

func (m *MockWarmPoolInterface) SetupUpdateMock() *mock.Call

SetupUpdateMock sets up a default mock response for Update

func (*MockWarmPoolInterface) SetupUpdateStatusMock

func (m *MockWarmPoolInterface) SetupUpdateStatusMock() *mock.Call

SetupUpdateStatusMock sets up a default mock response for UpdateStatus

func (*MockWarmPoolInterface) SetupWatchMock

func (m *MockWarmPoolInterface) SetupWatchMock() *mock.Call

SetupWatchMock sets up a mock response for Watch with any ListOptions

func (*MockWarmPoolInterface) Update

func (m *MockWarmPoolInterface) Update(warmPool *types.WarmPool) (*types.WarmPool, error)

func (*MockWarmPoolInterface) UpdateStatus

func (m *MockWarmPoolInterface) UpdateStatus(warmPool *types.WarmPool) (*types.WarmPool, error)

func (*MockWarmPoolInterface) Watch

type MockWatch

type MockWatch struct {
	mock.Mock
	// contains filtered or unexported fields
}

MockWatch implements watch.Interface for testing

func NewMockWatch

func NewMockWatch() *MockWatch

NewMockWatch creates a new mock watch

func (*MockWatch) ResultChan

func (m *MockWatch) ResultChan() <-chan watch.Event

ResultChan implements watch.Interface

func (*MockWatch) SendEvent

func (m *MockWatch) SendEvent(eventType watch.EventType, object runtime.Object)

SendEvent sends an event to the result channel

func (*MockWatch) Stop

func (m *MockWatch) Stop()

Stop implements watch.Interface

Jump to

Keyboard shortcuts

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