testutil

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultDate

func DefaultDate() time.Time

DefaultDate returns the default date used by other functions in this package

func GetExampleCACert

func GetExampleCACert(id int) []byte

GetExampleCACert returns one of several available sample CA certificates

func GetRunnables

func GetRunnables[T manager.Runnable](f *FakeManager) []T

GetRunnables returns the subset of FakeManagers' runnables, which are assertable to the specified type

func IsEqualCert

func IsEqualCert(cert1 *x509.CertPool, cert2 []byte) bool

IsEqualCert compares two certs, one represented as pool, the other - as a byte array

func NewTime

func NewTime(h, m, s int) time.Time

NewTime creates a Time object, using the specified values, and a DefaultDate

func NewTimeNowStub

func NewTimeNowStub(h, m, s int) func() time.Time

NewTimeNowStub creates test stub for the time.Now functions, using the specified values, and DefaultDate

Types

type FakeManager

type FakeManager struct {
	Scheme *runtime.Scheme
	Client client.Client
	// contains filtered or unexported fields
}

func NewFakeManager

func NewFakeManager() *FakeManager

func (*FakeManager) Add

func (f *FakeManager) Add(r manager.Runnable) error

func (*FakeManager) AddHealthzCheck

func (f *FakeManager) AddHealthzCheck(_ string, _ healthz.Checker) error

func (*FakeManager) AddMetricsExtraHandler

func (f *FakeManager) AddMetricsExtraHandler(_ string, _ http.Handler) error

func (*FakeManager) AddReadyzCheck

func (f *FakeManager) AddReadyzCheck(_ string, _ healthz.Checker) error

func (*FakeManager) Elected

func (f *FakeManager) Elected() <-chan struct{}

func (*FakeManager) GetAPIReader

func (f *FakeManager) GetAPIReader() client.Reader

func (*FakeManager) GetCache

func (f *FakeManager) GetCache() cache.Cache

func (*FakeManager) GetClient

func (f *FakeManager) GetClient() client.Client

func (*FakeManager) GetConfig

func (f *FakeManager) GetConfig() *rest.Config

func (*FakeManager) GetControllerOptions

func (f *FakeManager) GetControllerOptions() v1alpha1.ControllerConfigurationSpec

func (*FakeManager) GetEventRecorderFor

func (f *FakeManager) GetEventRecorderFor(_ string) record.EventRecorder

func (*FakeManager) GetFieldIndexer

func (f *FakeManager) GetFieldIndexer() client.FieldIndexer

func (*FakeManager) GetLogger

func (f *FakeManager) GetLogger() logr.Logger

func (*FakeManager) GetRESTMapper

func (f *FakeManager) GetRESTMapper() meta.RESTMapper

func (*FakeManager) GetScheme

func (f *FakeManager) GetScheme() *runtime.Scheme

func (*FakeManager) GetWebhookServer

func (f *FakeManager) GetWebhookServer() *webhook.Server

func (*FakeManager) SetFields

func (f *FakeManager) SetFields(_ interface{}) error

func (*FakeManager) Start

func (f *FakeManager) Start(_ context.Context) error

Jump to

Keyboard shortcuts

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