k8s

package
v0.0.2 Latest Latest
Warning

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

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

Documentation

Overview

Package k8s is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractNodeInstanceID

func ExtractNodeInstanceID(node *corev1.Node) (string, error)

func FilterNodeWithLabel

func FilterNodeWithLabel(nodes []*corev1.Node, nodeLabels map[string]string) []*corev1.Node

func GetNodeCondition

func GetNodeCondition(node *corev1.Node, conditionType corev1.NodeConditionType) *corev1.NodeCondition

GetNodeCondition will get pointer to Node's existing condition. returns nil if no matching condition found.

func HasFinalizer

func HasFinalizer(obj metav1.Object, finalizer string) bool

HasFinalizer tests whether k8s object has specified finalizer

func NamespacedName

func NamespacedName(obj metav1.Object) types.NamespacedName

NamespacedName returns the namespaced name for k8s objects

func NodeNames

func NodeNames(nodes []*corev1.Node) []string

NodeNames get all the node names.

func NodeSlicesEqual

func NodeSlicesEqual(x, y []*corev1.Node) bool

NodeSlicesEqual check if two nodes equals to each other.

func ToSliceOfNamespacedNames

func ToSliceOfNamespacedNames[T metav1.ObjectMetaAccessor](s []T) []types.NamespacedName

ToSliceOfNamespacedNames gets the slice of types.NamespacedName from the input slice s

Types

type FinalizerManager

type FinalizerManager interface {
	AddFinalizers(ctx context.Context, object client.Object, finalizers ...string) error
	RemoveFinalizers(ctx context.Context, object client.Object, finalizers ...string) error
}

func NewDefaultFinalizerManager

func NewDefaultFinalizerManager(k8sClient client.Client, log logr.Logger) FinalizerManager

type Getter

type Getter interface {
	GetClusterKubeconfig(ctx context.Context, clusterKey ctrlclient.ObjectKey) (string, error)
}

type KubeconfigGetter

type KubeconfigGetter struct{}

func (*KubeconfigGetter) GetClusterKubeconfig

func (k *KubeconfigGetter) GetClusterKubeconfig(ctx context.Context, clusterKey ctrlclient.ObjectKey) (string, error)

GetClusterKubeconfig returns the kubeconfig for a selected Cluster as a string.

type MockFinalizerManager

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

MockFinalizerManager is a mock of FinalizerManager interface.

func NewMockFinalizerManager

func NewMockFinalizerManager(ctrl *gomock.Controller) *MockFinalizerManager

NewMockFinalizerManager creates a new mock instance.

func (*MockFinalizerManager) AddFinalizers

func (m *MockFinalizerManager) AddFinalizers(arg0 context.Context, arg1 client.Object, arg2 ...string) error

AddFinalizers mocks base method.

func (*MockFinalizerManager) EXPECT

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

func (*MockFinalizerManager) RemoveFinalizers

func (m *MockFinalizerManager) RemoveFinalizers(arg0 context.Context, arg1 client.Object, arg2 ...string) error

RemoveFinalizers mocks base method.

type MockFinalizerManagerMockRecorder

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

MockFinalizerManagerMockRecorder is the mock recorder for MockFinalizerManager.

func (*MockFinalizerManagerMockRecorder) AddFinalizers

func (mr *MockFinalizerManagerMockRecorder) AddFinalizers(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call

AddFinalizers indicates an expected call of AddFinalizers.

func (*MockFinalizerManagerMockRecorder) RemoveFinalizers

func (mr *MockFinalizerManagerMockRecorder) RemoveFinalizers(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call

RemoveFinalizers indicates an expected call of RemoveFinalizers.

Jump to

Keyboard shortcuts

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