client

package
v0.0.8-prerelease Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2020 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMockedClient

func NewMockedClient() k8sClient.Client

Types

type Client

type Client interface {
	k8sClient.Client
	// TODO: remove this function, add mongodb package which has GetAndUpdate function
	GetAndUpdate(nsName types.NamespacedName, obj runtime.Object, updateFunc func()) error
	configmap.GetUpdateCreator
	service.GetUpdateCreator
	secret.GetUpdateCreateDeleter
	statefulset.GetUpdateCreateDeleter
}

func NewClient

func NewClient(c k8sClient.Client) Client

type MockedManager

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

MockedManager exists to unit test the reconciliation loops and wrap the mocked client

func NewManager

func NewManager(obj runtime.Object) *MockedManager

func (*MockedManager) Add

func (m *MockedManager) Add(_ manager.Runnable) error

func (*MockedManager) AddHealthzCheck

func (m *MockedManager) AddHealthzCheck(name string, check healthz.Checker) error

AddHealthzCheck allows you to add Healthz checker

func (*MockedManager) AddReadyzCheck

func (m *MockedManager) AddReadyzCheck(name string, check healthz.Checker) error

AddReadyzCheck allows you to add Readyz checker

func (*MockedManager) GetAPIReader

func (m *MockedManager) GetAPIReader() k8sClient.Reader

GetAPIReader returns the client reader

func (*MockedManager) GetAdmissionDecoder

func (m *MockedManager) GetAdmissionDecoder() admission.Decoder

GetAdmissionDecoder returns the runtime.Decoder based on the scheme.

func (*MockedManager) GetCache

func (m *MockedManager) GetCache() cache.Cache

GetCache returns a cache.Cache

func (*MockedManager) GetClient

func (m *MockedManager) GetClient() k8sClient.Client

GetClient returns a client configured with the Config

func (*MockedManager) GetConfig

func (m *MockedManager) GetConfig() *rest.Config

GetConfig returns an initialized Config

func (*MockedManager) GetEventRecorderFor

func (m *MockedManager) GetEventRecorderFor(_ string) record.EventRecorder

func (*MockedManager) GetFieldIndexer

func (m *MockedManager) GetFieldIndexer() k8sClient.FieldIndexer

GetFieldIndexer returns a client.FieldIndexer configured with the client

func (*MockedManager) GetRESTMapper

func (m *MockedManager) GetRESTMapper() meta.RESTMapper

GetRESTMapper returns a RESTMapper

func (*MockedManager) GetRecorder

func (m *MockedManager) GetRecorder(_ string) record.EventRecorder

GetRecorder returns a new EventRecorder for the provided name

func (*MockedManager) GetScheme

func (m *MockedManager) GetScheme() *runtime.Scheme

GetScheme returns and initialized Scheme

func (*MockedManager) GetWebhookServer

func (m *MockedManager) GetWebhookServer() *webhook.Server

func (*MockedManager) SetFields

func (m *MockedManager) SetFields(interface{}) error

SetFields will set any dependencies on an object for which the object has implemented the inject interface - e.g. inject.Client.

func (*MockedManager) Start

func (m *MockedManager) Start(<-chan struct{}) error

Start starts all registered Controllers and blocks until the Stop channel is closed. Returns an error if there is an error starting any controller.

Jump to

Keyboard shortcuts

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