controllerHelpers

package
v0.6.3 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2022 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event struct {
	Message   string
	EventType string
	Reason    string
}

type FakeCore

type FakeCore struct {
}

func (FakeCore) ConfigMap

func (FakeCore) Endpoints

func (FakeCore) Event

func (FakeCore) Namespace

func (FakeCore) Node

func (FakeCore) PersistentVolumeClaim

func (f FakeCore) PersistentVolumeClaim() corecontrollers.PersistentVolumeClaimController

func (FakeCore) Pod

func (FakeCore) Secret

func (FakeCore) Service

func (FakeCore) ServiceAccount

type FakeElementalV1beta1

type FakeElementalV1beta1 struct{}

FakeElementalV1beta1 is a struct that implements the ElementalController interface

func (*FakeElementalV1beta1) MachineInventory

func (*FakeElementalV1beta1) MachineInventorySelector

func (*FakeElementalV1beta1) MachineInventorySelectorTemplate

func (*FakeElementalV1beta1) MachineRegistration

func (*FakeElementalV1beta1) ManagedOSImage

func (*FakeElementalV1beta1) ManagedOSVersion

func (*FakeElementalV1beta1) ManagedOSVersionChannel

type FakeMachineInventory

type FakeMachineInventory struct {
	UpdateStatusCalled bool
	FailOnUpdateStatus bool
	// contains filtered or unexported fields
}

FakeMachineInventory is the fake inventory controller

func (*FakeMachineInventory) Create

func (*FakeMachineInventory) Delete

func (f *FakeMachineInventory) Delete(namespace, name string, options *metav1.DeleteOptions) error

func (*FakeMachineInventory) Get

func (f *FakeMachineInventory) Get(namespace, name string, options metav1.GetOptions) (*v1beta1.MachineInventory, error)

func (*FakeMachineInventory) GetInventory

func (f *FakeMachineInventory) GetInventory() *v1beta1.MachineInventory

func (*FakeMachineInventory) List

func (*FakeMachineInventory) Patch

func (f *FakeMachineInventory) Patch(namespace, name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.MachineInventory, err error)

func (*FakeMachineInventory) Update

func (*FakeMachineInventory) UpdateStatus

func (*FakeMachineInventory) Watch

func (f *FakeMachineInventory) Watch(namespace string, opts metav1.ListOptions) (watch.Interface, error)

type FakeMachineInventoryIndexer

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

FakeMachineInventoryIndexer is a fake index cache TODO: Fake a proper index cache? We could probably have a generic one for all controllers testing

func (*FakeMachineInventoryIndexer) AddIndexer

func (*FakeMachineInventoryIndexer) AddToIndex

func (*FakeMachineInventoryIndexer) CleanIndex

func (f *FakeMachineInventoryIndexer) CleanIndex()

func (*FakeMachineInventoryIndexer) Get

func (f *FakeMachineInventoryIndexer) Get(namespace, name string) (*v1beta1.MachineInventory, error)

func (*FakeMachineInventoryIndexer) GetByIndex

func (f *FakeMachineInventoryIndexer) GetByIndex(indexName, key string) ([]*v1beta1.MachineInventory, error)

func (*FakeMachineInventoryIndexer) List

func (f *FakeMachineInventoryIndexer) List(namespace string, selector labels.Selector) ([]*v1beta1.MachineInventory, error)

type FakeMachineRegistration

type FakeMachineRegistration struct {
}

func (FakeMachineRegistration) AddGenericHandler

func (f FakeMachineRegistration) AddGenericHandler(ctx context.Context, name string, handler generic.Handler)

func (FakeMachineRegistration) AddGenericRemoveHandler

func (f FakeMachineRegistration) AddGenericRemoveHandler(ctx context.Context, name string, handler generic.Handler)

func (FakeMachineRegistration) Cache

func (FakeMachineRegistration) Create

func (FakeMachineRegistration) Delete

func (f FakeMachineRegistration) Delete(namespace, name string, options *metav1.DeleteOptions) error

func (FakeMachineRegistration) Enqueue

func (f FakeMachineRegistration) Enqueue(namespace, name string)

func (FakeMachineRegistration) EnqueueAfter

func (f FakeMachineRegistration) EnqueueAfter(namespace, name string, duration time.Duration)

func (FakeMachineRegistration) Get

func (f FakeMachineRegistration) Get(namespace, name string, options metav1.GetOptions) (*v1beta1.MachineRegistration, error)

func (FakeMachineRegistration) GroupVersionKind

func (f FakeMachineRegistration) GroupVersionKind() schema.GroupVersionKind

func (FakeMachineRegistration) Informer

func (FakeMachineRegistration) List

func (FakeMachineRegistration) OnChange

func (FakeMachineRegistration) OnRemove

func (FakeMachineRegistration) Patch

func (f FakeMachineRegistration) Patch(namespace, name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.MachineRegistration, err error)

func (FakeMachineRegistration) Update

func (FakeMachineRegistration) UpdateStatus

func (FakeMachineRegistration) Updater

func (FakeMachineRegistration) Watch

type FakeManagedOSVersionChannel

type FakeManagedOSVersionChannel struct {
	generic.ControllerMeta
}

func (FakeManagedOSVersionChannel) Cache

func (FakeManagedOSVersionChannel) Create

func (FakeManagedOSVersionChannel) Delete

func (f FakeManagedOSVersionChannel) Delete(namespace, name string, options *metav1.DeleteOptions) error

func (FakeManagedOSVersionChannel) Enqueue

func (f FakeManagedOSVersionChannel) Enqueue(namespace, name string)

func (FakeManagedOSVersionChannel) EnqueueAfter

func (f FakeManagedOSVersionChannel) EnqueueAfter(namespace, name string, duration time.Duration)

func (FakeManagedOSVersionChannel) Get

func (FakeManagedOSVersionChannel) List

func (FakeManagedOSVersionChannel) OnChange

func (FakeManagedOSVersionChannel) OnRemove

func (FakeManagedOSVersionChannel) Patch

func (f FakeManagedOSVersionChannel) Patch(namespace, name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.ManagedOSVersionChannel, err error)

func (FakeManagedOSVersionChannel) Update

func (FakeManagedOSVersionChannel) UpdateStatus

func (FakeManagedOSVersionChannel) Watch

type FakeRBAC

type FakeRBAC struct {
}

func (*FakeRBAC) ClusterRole

func (*FakeRBAC) ClusterRoleBinding

func (f *FakeRBAC) ClusterRoleBinding() rbaccontrollers.ClusterRoleBindingController

func (*FakeRBAC) Role

func (*FakeRBAC) RoleBinding

type FakeRancher

type FakeRancher struct {
}

func (FakeRancher) Setting

type FakeRecorder

type FakeRecorder struct {
	Events []Event
}

func (*FakeRecorder) AnnotatedEventf

func (f *FakeRecorder) AnnotatedEventf(object runtime.Object, annotations map[string]string, eventtype, reason, messageFmt string, args ...interface{})

func (*FakeRecorder) Event

func (f *FakeRecorder) Event(object runtime.Object, eventtype, reason, message string)

Event will record the event with the object name in the FakeRecorder.Events

func (*FakeRecorder) Eventf

func (f *FakeRecorder) Eventf(object runtime.Object, eventtype, reason, messageFmt string, args ...interface{})

type FakeRole

type FakeRole struct {
}

func (*FakeRole) AddGenericHandler

func (f *FakeRole) AddGenericHandler(ctx context.Context, name string, handler generic.Handler)

func (*FakeRole) AddGenericRemoveHandler

func (f *FakeRole) AddGenericRemoveHandler(ctx context.Context, name string, handler generic.Handler)

func (*FakeRole) Cache

func (f *FakeRole) Cache() rbaccontrollers.RoleCache

func (*FakeRole) Create

func (f *FakeRole) Create(role *rbacv1.Role) (*rbacv1.Role, error)

func (*FakeRole) Delete

func (f *FakeRole) Delete(namespace, name string, options *metav1.DeleteOptions) error

func (*FakeRole) Enqueue

func (f *FakeRole) Enqueue(namespace, name string)

func (*FakeRole) EnqueueAfter

func (f *FakeRole) EnqueueAfter(namespace, name string, duration time.Duration)

func (*FakeRole) Get

func (f *FakeRole) Get(namespace, name string, options metav1.GetOptions) (*rbacv1.Role, error)

func (*FakeRole) GroupVersionKind

func (f *FakeRole) GroupVersionKind() schema.GroupVersionKind

func (*FakeRole) Informer

func (f *FakeRole) Informer() cache.SharedIndexInformer

func (*FakeRole) List

func (f *FakeRole) List(namespace string, opts metav1.ListOptions) (*rbacv1.RoleList, error)

func (*FakeRole) OnChange

func (f *FakeRole) OnChange(ctx context.Context, name string, sync rbaccontrollers.RoleHandler)

func (*FakeRole) OnRemove

func (f *FakeRole) OnRemove(ctx context.Context, name string, sync rbaccontrollers.RoleHandler)

func (*FakeRole) Patch

func (f *FakeRole) Patch(namespace, name string, pt types.PatchType, data []byte, subresources ...string) (result *rbacv1.Role, err error)

func (*FakeRole) Update

func (f *FakeRole) Update(role *rbacv1.Role) (*rbacv1.Role, error)

func (*FakeRole) Updater

func (f *FakeRole) Updater() generic.Updater

func (*FakeRole) Watch

func (f *FakeRole) Watch(namespace string, opts metav1.ListOptions) (watch.Interface, error)

type FakeRoleBinding

type FakeRoleBinding struct{}

func (*FakeRoleBinding) AddGenericHandler

func (f *FakeRoleBinding) AddGenericHandler(ctx context.Context, name string, handler generic.Handler)

func (*FakeRoleBinding) AddGenericRemoveHandler

func (f *FakeRoleBinding) AddGenericRemoveHandler(ctx context.Context, name string, handler generic.Handler)

func (*FakeRoleBinding) Cache

func (*FakeRoleBinding) Create

func (f *FakeRoleBinding) Create(binding *rbacv1.RoleBinding) (*rbacv1.RoleBinding, error)

func (*FakeRoleBinding) Delete

func (f *FakeRoleBinding) Delete(namespace, name string, options *metav1.DeleteOptions) error

func (*FakeRoleBinding) Enqueue

func (f *FakeRoleBinding) Enqueue(namespace, name string)

func (*FakeRoleBinding) EnqueueAfter

func (f *FakeRoleBinding) EnqueueAfter(namespace, name string, duration time.Duration)

func (*FakeRoleBinding) Get

func (f *FakeRoleBinding) Get(namespace, name string, options metav1.GetOptions) (*rbacv1.RoleBinding, error)

func (*FakeRoleBinding) GroupVersionKind

func (f *FakeRoleBinding) GroupVersionKind() schema.GroupVersionKind

func (*FakeRoleBinding) Informer

func (*FakeRoleBinding) List

func (f *FakeRoleBinding) List(namespace string, opts metav1.ListOptions) (*rbacv1.RoleBindingList, error)

func (*FakeRoleBinding) OnChange

func (*FakeRoleBinding) OnRemove

func (*FakeRoleBinding) Patch

func (f *FakeRoleBinding) Patch(namespace, name string, pt types.PatchType, data []byte, subresources ...string) (result *rbacv1.RoleBinding, err error)

func (*FakeRoleBinding) Update

func (f *FakeRoleBinding) Update(binding *rbacv1.RoleBinding) (*rbacv1.RoleBinding, error)

func (*FakeRoleBinding) Updater

func (f *FakeRoleBinding) Updater() generic.Updater

func (*FakeRoleBinding) Watch

func (f *FakeRoleBinding) Watch(namespace string, opts metav1.ListOptions) (watch.Interface, error)

type FakeSecret

type FakeSecret struct {
}

func (FakeSecret) AddGenericHandler

func (f FakeSecret) AddGenericHandler(ctx context.Context, name string, handler generic.Handler)

func (FakeSecret) AddGenericRemoveHandler

func (f FakeSecret) AddGenericRemoveHandler(ctx context.Context, name string, handler generic.Handler)

func (FakeSecret) Cache

func (FakeSecret) Create

func (f FakeSecret) Create(secret *corev1.Secret) (*corev1.Secret, error)

func (FakeSecret) Delete

func (f FakeSecret) Delete(namespace, name string, options *metav1.DeleteOptions) error

func (FakeSecret) Enqueue

func (f FakeSecret) Enqueue(namespace, name string)

func (FakeSecret) EnqueueAfter

func (f FakeSecret) EnqueueAfter(namespace, name string, duration time.Duration)

func (FakeSecret) Get

func (f FakeSecret) Get(namespace, name string, options metav1.GetOptions) (*corev1.Secret, error)

func (FakeSecret) GroupVersionKind

func (f FakeSecret) GroupVersionKind() schema.GroupVersionKind

func (FakeSecret) Informer

func (f FakeSecret) Informer() cache.SharedIndexInformer

func (FakeSecret) List

func (f FakeSecret) List(namespace string, opts metav1.ListOptions) (*corev1.SecretList, error)

func (FakeSecret) OnChange

func (f FakeSecret) OnChange(ctx context.Context, name string, sync corecontrollers.SecretHandler)

func (FakeSecret) OnRemove

func (f FakeSecret) OnRemove(ctx context.Context, name string, sync corecontrollers.SecretHandler)

func (FakeSecret) Patch

func (f FakeSecret) Patch(namespace, name string, pt types.PatchType, data []byte, subresources ...string) (result *corev1.Secret, err error)

func (FakeSecret) Update

func (f FakeSecret) Update(*corev1.Secret) (*corev1.Secret, error)

func (FakeSecret) Updater

func (f FakeSecret) Updater() generic.Updater

func (FakeSecret) Watch

func (f FakeSecret) Watch(namespace string, opts metav1.ListOptions) (watch.Interface, error)

type FakeServiceAccount

type FakeServiceAccount struct {
}

func (FakeServiceAccount) AddGenericHandler

func (f FakeServiceAccount) AddGenericHandler(ctx context.Context, name string, handler generic.Handler)

func (FakeServiceAccount) AddGenericRemoveHandler

func (f FakeServiceAccount) AddGenericRemoveHandler(ctx context.Context, name string, handler generic.Handler)

func (FakeServiceAccount) Cache

func (FakeServiceAccount) Create

func (FakeServiceAccount) Delete

func (f FakeServiceAccount) Delete(namespace, name string, options *metav1.DeleteOptions) error

func (FakeServiceAccount) Enqueue

func (f FakeServiceAccount) Enqueue(namespace, name string)

func (FakeServiceAccount) EnqueueAfter

func (f FakeServiceAccount) EnqueueAfter(namespace, name string, duration time.Duration)

func (FakeServiceAccount) Get

func (f FakeServiceAccount) Get(namespace, name string, options metav1.GetOptions) (*corev1.ServiceAccount, error)

func (FakeServiceAccount) GroupVersionKind

func (f FakeServiceAccount) GroupVersionKind() schema.GroupVersionKind

func (FakeServiceAccount) Informer

func (FakeServiceAccount) List

func (FakeServiceAccount) OnChange

func (FakeServiceAccount) OnRemove

func (FakeServiceAccount) Patch

func (f FakeServiceAccount) Patch(namespace, name string, pt types.PatchType, data []byte, subresources ...string) (result *corev1.ServiceAccount, err error)

func (FakeServiceAccount) Update

func (FakeServiceAccount) Updater

func (f FakeServiceAccount) Updater() generic.Updater

func (FakeServiceAccount) Watch

func (f FakeServiceAccount) Watch(namespace string, opts metav1.ListOptions) (watch.Interface, error)

type FakeSetting

type FakeSetting struct {
}

func (FakeSetting) AddGenericHandler

func (f FakeSetting) AddGenericHandler(ctx context.Context, name string, handler generic.Handler)

func (FakeSetting) AddGenericRemoveHandler

func (f FakeSetting) AddGenericRemoveHandler(ctx context.Context, name string, handler generic.Handler)

func (FakeSetting) Cache

func (FakeSetting) Create

func (f FakeSetting) Create(setting *v3.Setting) (*v3.Setting, error)

func (FakeSetting) Delete

func (f FakeSetting) Delete(name string, options *metav1.DeleteOptions) error

func (FakeSetting) Enqueue

func (f FakeSetting) Enqueue(name string)

func (FakeSetting) EnqueueAfter

func (f FakeSetting) EnqueueAfter(name string, duration time.Duration)

func (FakeSetting) Get

func (f FakeSetting) Get(name string, options metav1.GetOptions) (*v3.Setting, error)

func (FakeSetting) GroupVersionKind

func (f FakeSetting) GroupVersionKind() schema.GroupVersionKind

func (FakeSetting) Informer

func (f FakeSetting) Informer() cache.SharedIndexInformer

func (FakeSetting) List

func (f FakeSetting) List(opts metav1.ListOptions) (*v3.SettingList, error)

func (FakeSetting) OnChange

func (f FakeSetting) OnChange(ctx context.Context, name string, sync ranchercontrollers.SettingHandler)

func (FakeSetting) OnRemove

func (f FakeSetting) OnRemove(ctx context.Context, name string, sync ranchercontrollers.SettingHandler)

func (FakeSetting) Patch

func (f FakeSetting) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v3.Setting, err error)

func (FakeSetting) Update

func (f FakeSetting) Update(setting *v3.Setting) (*v3.Setting, error)

func (FakeSetting) Updater

func (f FakeSetting) Updater() generic.Updater

func (FakeSetting) Watch

type FakeSettingCache

type FakeSettingCache struct {
	Index map[string]*v3.Setting
}

func (*FakeSettingCache) AddIndexer

func (f *FakeSettingCache) AddIndexer(indexName string, indexer v3generated.SettingIndexer)

func (*FakeSettingCache) AddToIndex

func (f *FakeSettingCache) AddToIndex(name string, setting *v3.Setting)

func (*FakeSettingCache) Get

func (f *FakeSettingCache) Get(name string) (*v3.Setting, error)

func (*FakeSettingCache) GetByIndex

func (f *FakeSettingCache) GetByIndex(indexName, key string) ([]*v3.Setting, error)

func (*FakeSettingCache) List

func (f *FakeSettingCache) List(selector labels.Selector) ([]*v3.Setting, error)

type TestClients

type TestClients struct {
	Recorder *FakeRecorder
}

TestClients is a test client that fills the clients.ClientInterface

func (*TestClients) Apply

func (c *TestClients) Apply() apply.Apply

func (*TestClients) CAPI

func (c *TestClients) CAPI() capi.Interface

func (*TestClients) Core

func (*TestClients) Elemental

func (c *TestClients) Elemental() elmcontrollers.Interface

func (*TestClients) EventRecorder

func (c *TestClients) EventRecorder(name string) record.EventRecorder

func (*TestClients) Fleet

func (*TestClients) K8s

func (c *TestClients) K8s() kubernetes.Interface

func (*TestClients) RBAC

func (*TestClients) Rancher

func (*TestClients) Start

func (c *TestClients) Start(ctx context.Context) error

Jump to

Keyboard shortcuts

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