k8sutil

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2024 License: Apache-2.0 Imports: 18 Imported by: 7

Documentation

Overview

Package k8sutil is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteDeployment added in v0.7.0

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

func GetDeployment added in v0.6.0

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 added in v0.6.0

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 added in v0.8.0

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

func (*Clientsets) DeleteResourcesDynamically added in v0.7.0

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

func (*Clientsets) GetResourcesDynamically added in v0.7.0

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

func (*Clientsets) ListResourcesDynamically added in v0.7.0

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

func (*Clientsets) PatchResourcesDynamically added in v0.7.0

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 added in v0.7.0

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 added in v0.7.0

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

MockClientsetsInterface is a mock of ClientsetsInterface interface.

func NewMockClientsetsInterface added in v0.7.0

func NewMockClientsetsInterface(ctrl *gomock.Controller) *MockClientsetsInterface

NewMockClientsetsInterface creates a new mock instance.

func (*MockClientsetsInterface) CreateResourcesDynamically added in v0.8.0

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 added in v0.7.0

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

DeleteResourcesDynamically mocks base method.

func (*MockClientsetsInterface) EXPECT added in v0.7.0

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

func (*MockClientsetsInterface) GetResourcesDynamically added in v0.7.0

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

GetResourcesDynamically mocks base method.

func (*MockClientsetsInterface) ListResourcesDynamically added in v0.7.0

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

ListResourcesDynamically mocks base method.

func (*MockClientsetsInterface) PatchResourcesDynamically added in v0.7.0

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 added in v0.7.0

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

MockClientsetsInterfaceMockRecorder is the mock recorder for MockClientsetsInterface.

func (*MockClientsetsInterfaceMockRecorder) CreateResourcesDynamically added in v0.8.0

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

CreateResourcesDynamically indicates an expected call of CreateResourcesDynamically.

func (*MockClientsetsInterfaceMockRecorder) DeleteResourcesDynamically added in v0.7.0

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

DeleteResourcesDynamically indicates an expected call of DeleteResourcesDynamically.

func (*MockClientsetsInterfaceMockRecorder) GetResourcesDynamically added in v0.7.0

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

GetResourcesDynamically indicates an expected call of GetResourcesDynamically.

func (*MockClientsetsInterfaceMockRecorder) ListResourcesDynamically added in v0.7.0

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

ListResourcesDynamically indicates an expected call of ListResourcesDynamically.

func (*MockClientsetsInterfaceMockRecorder) PatchResourcesDynamically added in v0.7.0

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