Documentation ¶
Overview ¶
Package k8s is a generated GoMock package.
Index ¶
- func ExtractNodeInstanceID(node *corev1.Node) (string, error)
- func FilterNodeWithLabel(nodes []*corev1.Node, nodeLabels map[string]string) []*corev1.Node
- func GetNodeCondition(node *corev1.Node, conditionType corev1.NodeConditionType) *corev1.NodeCondition
- func HasFinalizer(obj metav1.Object, finalizer string) bool
- func NamespacedName(obj metav1.Object) types.NamespacedName
- func NodeNames(nodes []*corev1.Node) []string
- func NodeSlicesEqual(x, y []*corev1.Node) bool
- func ToSliceOfNamespacedNames[T metav1.ObjectMetaAccessor](s []T) []types.NamespacedName
- type FinalizerManager
- type Getter
- type KubeconfigGetter
- type MockFinalizerManager
- type MockFinalizerManagerMockRecorder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FilterNodeWithLabel ¶
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 ¶
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 NodeSlicesEqual ¶
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 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 ¶
func (m *MockFinalizerManager) EXPECT() *MockFinalizerManagerMockRecorder
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.