Documentation
¶
Index ¶
- Variables
- type K8sAdapter
- type MockK8sAdapter
- type MockK8sAdapter_Expecter
- type MockK8sAdapter_GetClient_Call
- func (_c *MockK8sAdapter_GetClient_Call) Return(clientset *kubernetes.Clientset) *MockK8sAdapter_GetClient_Call
- func (_c *MockK8sAdapter_GetClient_Call) Run(run func()) *MockK8sAdapter_GetClient_Call
- func (_c *MockK8sAdapter_GetClient_Call) RunAndReturn(run func() *kubernetes.Clientset) *MockK8sAdapter_GetClient_Call
- type MockK8sAdapter_GetPodByPodUID_Call
- func (_c *MockK8sAdapter_GetPodByPodUID_Call) Return(pod v1.Pod, err error) *MockK8sAdapter_GetPodByPodUID_Call
- func (_c *MockK8sAdapter_GetPodByPodUID_Call) Run(run func(ctx context.Context, podUID string)) *MockK8sAdapter_GetPodByPodUID_Call
- func (_c *MockK8sAdapter_GetPodByPodUID_Call) RunAndReturn(run func(ctx context.Context, podUID string) (v1.Pod, error)) *MockK8sAdapter_GetPodByPodUID_Call
- type Options
Constants ¶
This section is empty.
Variables ¶
var ( ErrNoKubeConfig = errors.New("no Kubernetes configuration available") ErrKubeClientNotInit = errors.New("Kubernetes client not initialized") ErrNamespaceAccess = errors.New("failed to access Kubernetes namespaces") ErrPodAccess = errors.New("failed to access Kubernetes pods") ErrPodNotFound = errors.New("pod not found in any namespace") )
Define error types
Functions ¶
This section is empty.
Types ¶
type K8sAdapter ¶
type K8sAdapter interface {
GetPodByPodUID(ctx context.Context, podUID string) (apiv1.Pod, error)
GetClient() *kubernetes.Clientset
}
func NewK8SAdapter ¶
func NewK8SAdapter(options Options) (K8sAdapter, error)
NewK8SAdapter creates a new Kubernetes adapter based on command line options. Supports two modes: 1. When running inside the cluster, use in-cluster configuration 2. When running outside the cluster, use kubeconfig configuration
type MockK8sAdapter ¶
MockK8sAdapter is an autogenerated mock type for the K8sAdapter type
func NewMockK8sAdapter ¶
func NewMockK8sAdapter(t interface {
mock.TestingT
Cleanup(func())
}) *MockK8sAdapter
NewMockK8sAdapter creates a new instance of MockK8sAdapter. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*MockK8sAdapter) EXPECT ¶
func (_m *MockK8sAdapter) EXPECT() *MockK8sAdapter_Expecter
func (*MockK8sAdapter) GetClient ¶
func (_mock *MockK8sAdapter) GetClient() *kubernetes.Clientset
GetClient provides a mock function for the type MockK8sAdapter
func (*MockK8sAdapter) GetPodByPodUID ¶
func (_mock *MockK8sAdapter) GetPodByPodUID(ctx context.Context, podUID string) (v1.Pod, error)
GetPodByPodUID provides a mock function for the type MockK8sAdapter
type MockK8sAdapter_Expecter ¶
type MockK8sAdapter_Expecter struct {
// contains filtered or unexported fields
}
func (*MockK8sAdapter_Expecter) GetClient ¶
func (_e *MockK8sAdapter_Expecter) GetClient() *MockK8sAdapter_GetClient_Call
GetClient is a helper method to define mock.On call
func (*MockK8sAdapter_Expecter) GetPodByPodUID ¶
func (_e *MockK8sAdapter_Expecter) GetPodByPodUID(ctx interface{}, podUID interface{}) *MockK8sAdapter_GetPodByPodUID_Call
GetPodByPodUID is a helper method to define mock.On call
- ctx context.Context
- podUID string
type MockK8sAdapter_GetClient_Call ¶
MockK8sAdapter_GetClient_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetClient'
func (*MockK8sAdapter_GetClient_Call) Return ¶
func (_c *MockK8sAdapter_GetClient_Call) Return(clientset *kubernetes.Clientset) *MockK8sAdapter_GetClient_Call
func (*MockK8sAdapter_GetClient_Call) Run ¶
func (_c *MockK8sAdapter_GetClient_Call) Run(run func()) *MockK8sAdapter_GetClient_Call
func (*MockK8sAdapter_GetClient_Call) RunAndReturn ¶
func (_c *MockK8sAdapter_GetClient_Call) RunAndReturn(run func() *kubernetes.Clientset) *MockK8sAdapter_GetClient_Call
type MockK8sAdapter_GetPodByPodUID_Call ¶
MockK8sAdapter_GetPodByPodUID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPodByPodUID'
func (*MockK8sAdapter_GetPodByPodUID_Call) Return ¶
func (_c *MockK8sAdapter_GetPodByPodUID_Call) Return(pod v1.Pod, err error) *MockK8sAdapter_GetPodByPodUID_Call
func (*MockK8sAdapter_GetPodByPodUID_Call) Run ¶
func (_c *MockK8sAdapter_GetPodByPodUID_Call) Run(run func(ctx context.Context, podUID string)) *MockK8sAdapter_GetPodByPodUID_Call
func (*MockK8sAdapter_GetPodByPodUID_Call) RunAndReturn ¶
func (_c *MockK8sAdapter_GetPodByPodUID_Call) RunAndReturn(run func(ctx context.Context, podUID string) (v1.Pod, error)) *MockK8sAdapter_GetPodByPodUID_Call