k8sutil

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Package k8sutil is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteDeployment

func DeleteDeployment(ctx context.Context, k8sclientset kubernetes.Interface, clusterNamespace string, deployment string)

func GetDeployment

func GetDeployment(ctx context.Context, k8sclientset kubernetes.Interface, clusterNamespace, deploymentName string) (*appsv1.Deployment, error)

func RestartDeployment

func RestartDeployment(ctx context.Context, k8sclientset kubernetes.Interface, namespace, deploymentName string)

func SetDeploymentScale

func SetDeploymentScale(ctx context.Context, k8sclientset kubernetes.Interface, namespace, deploymentName string, scaleCount int) error

func UpdateConfigMap

func UpdateConfigMap(ctx context.Context, k8sclientset kubernetes.Interface, namespace, configMapName, key, value string)

func WaitForPodToRun

func WaitForPodToRun(ctx context.Context, k8sclientset kubernetes.Interface, namespace, labelSelector string) (corev1.Pod, error)

Types

type Clientsets

type Clientsets struct {
	// The Kubernetes config used for these client sets
	KubeConfig *rest.Config

	// Kube is a connection to the core Kubernetes API
	Kube kubernetes.Interface

	// Rook is a typed connection to the rook API
	Rook rookclient.Interface

	// Dynamic is used for manage dynamic resources
	Dynamic dynamic.Interface
}

func (*Clientsets) CreateResourcesDynamically

func (c *Clientsets) CreateResourcesDynamically(
	ctx context.Context,
	group string,
	version string,
	resource string,
	name *unstructured.Unstructured,
	namespace string,
) (*unstructured.Unstructured, error)

func (*Clientsets) DeleteResourcesDynamically

func (c *Clientsets) DeleteResourcesDynamically(
	ctx context.Context,
	group string,
	version string,
	resource string,
	namespace string,
	resourceName string,
) error

func (*Clientsets) GetResourcesDynamically

func (c *Clientsets) GetResourcesDynamically(
	ctx context.Context,
	group string,
	version string,
	resource string,
	name string,
	namespace string,
) (*unstructured.Unstructured, error)

func (*Clientsets) ListResourcesDynamically

func (c *Clientsets) ListResourcesDynamically(
	ctx context.Context,
	group string,
	version string,
	resource string,
	namespace string,
) ([]unstructured.Unstructured, error)

func (*Clientsets) PatchResourcesDynamically

func (c *Clientsets) PatchResourcesDynamically(
	ctx context.Context,
	group string,
	version string,
	resource string,
	namespace string,
	resourceName string,
	pt types.PatchType,
	data []byte,
) error

type ClientsetsInterface

type ClientsetsInterface interface {
	CreateResourcesDynamically(ctx context.Context, group string, version string, resource string, name *unstructured.Unstructured, namespace string) (*unstructured.Unstructured, error)
	ListResourcesDynamically(ctx context.Context, group string, version string, resource string, namespace string) ([]unstructured.Unstructured, error)
	GetResourcesDynamically(ctx context.Context, group string, version string, resource string, name string, namespace string) (*unstructured.Unstructured, error)
	DeleteResourcesDynamically(ctx context.Context, group string, version string, resource string, namespace string, resourceName string) error
	PatchResourcesDynamically(ctx context.Context, group string, version string, resource string, namespace string, resourceName string, pt types.PatchType, data []byte) error
}

type MockClientsetsInterface

type MockClientsetsInterface struct {
	// contains filtered or unexported fields
}

MockClientsetsInterface is a mock of ClientsetsInterface interface.

func NewMockClientsetsInterface

func NewMockClientsetsInterface(ctrl *gomock.Controller) *MockClientsetsInterface

NewMockClientsetsInterface creates a new mock instance.

func (*MockClientsetsInterface) CreateResourcesDynamically

func (m *MockClientsetsInterface) CreateResourcesDynamically(arg0 context.Context, arg1, arg2, arg3 string, arg4 *unstructured.Unstructured, arg5 string) (*unstructured.Unstructured, error)

CreateResourcesDynamically mocks base method.

func (*MockClientsetsInterface) DeleteResourcesDynamically

func (m *MockClientsetsInterface) DeleteResourcesDynamically(arg0 context.Context, arg1, arg2, arg3, arg4, arg5 string) error

DeleteResourcesDynamically mocks base method.

func (*MockClientsetsInterface) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockClientsetsInterface) GetResourcesDynamically

func (m *MockClientsetsInterface) GetResourcesDynamically(arg0 context.Context, arg1, arg2, arg3, arg4, arg5 string) (*unstructured.Unstructured, error)

GetResourcesDynamically mocks base method.

func (*MockClientsetsInterface) ListResourcesDynamically

func (m *MockClientsetsInterface) ListResourcesDynamically(arg0 context.Context, arg1, arg2, arg3, arg4 string) ([]unstructured.Unstructured, error)

ListResourcesDynamically mocks base method.

func (*MockClientsetsInterface) PatchResourcesDynamically

func (m *MockClientsetsInterface) PatchResourcesDynamically(arg0 context.Context, arg1, arg2, arg3, arg4, arg5 string, arg6 types.PatchType, arg7 []byte) error

PatchResourcesDynamically mocks base method.

type MockClientsetsInterfaceMockRecorder

type MockClientsetsInterfaceMockRecorder struct {
	// contains filtered or unexported fields
}

MockClientsetsInterfaceMockRecorder is the mock recorder for MockClientsetsInterface.

func (*MockClientsetsInterfaceMockRecorder) CreateResourcesDynamically

func (mr *MockClientsetsInterfaceMockRecorder) CreateResourcesDynamically(arg0, arg1, arg2, arg3, arg4, arg5 interface{}) *gomock.Call

CreateResourcesDynamically indicates an expected call of CreateResourcesDynamically.

func (*MockClientsetsInterfaceMockRecorder) DeleteResourcesDynamically

func (mr *MockClientsetsInterfaceMockRecorder) DeleteResourcesDynamically(arg0, arg1, arg2, arg3, arg4, arg5 interface{}) *gomock.Call

DeleteResourcesDynamically indicates an expected call of DeleteResourcesDynamically.

func (*MockClientsetsInterfaceMockRecorder) GetResourcesDynamically

func (mr *MockClientsetsInterfaceMockRecorder) GetResourcesDynamically(arg0, arg1, arg2, arg3, arg4, arg5 interface{}) *gomock.Call

GetResourcesDynamically indicates an expected call of GetResourcesDynamically.

func (*MockClientsetsInterfaceMockRecorder) ListResourcesDynamically

func (mr *MockClientsetsInterfaceMockRecorder) ListResourcesDynamically(arg0, arg1, arg2, arg3, arg4 interface{}) *gomock.Call

ListResourcesDynamically indicates an expected call of ListResourcesDynamically.

func (*MockClientsetsInterfaceMockRecorder) PatchResourcesDynamically

func (mr *MockClientsetsInterfaceMockRecorder) PatchResourcesDynamically(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7 interface{}) *gomock.Call

PatchResourcesDynamically indicates an expected call of PatchResourcesDynamically.

Jump to

Keyboard shortcuts

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