testenv

package
v1.0.0-alpha.5 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssetBinPath added in v0.3.0

func AssetBinPath(name string) string

func CreateObjects added in v0.3.0

func CreateObjects(objects []runtime.Object) error

func DeleteObjects added in v0.3.0

func DeleteObjects(objects []runtime.Object) error

func GetChangedObjects added in v0.3.0

func GetChangedObjects(changes []Change) ([]runtime.Object, error)

func GetClient added in v0.3.0

func GetClient() client.Client

func GetScheme added in v0.3.0

func GetScheme() *runtime.Scheme

func ProjectDir added in v0.3.0

func ProjectDir() string

func RunSpecsInEnvironment added in v0.3.0

func RunSpecsInEnvironment(t *testing.T, desc string)

Types

type Change added in v0.3.0

type Change struct {
	schema.GroupVersionKind
	types.NamespacedName

	Type string
}

func GetChanges added in v0.3.0

func GetChanges(c interface{}) []Change

type Environment added in v0.3.0

type Environment struct {
	ControlPlane      *envtest.ControlPlane
	CRDInstallOptions envtest.CRDInstallOptions
	// contains filtered or unexported fields
}
var Env *Environment

Env is a global environment for testing. nolint: gochecknoglobals

func (*Environment) GetClient added in v0.3.0

func (e *Environment) GetClient() client.Client

func (*Environment) GetConfig added in v0.3.0

func (e *Environment) GetConfig() *rest.Config

func (*Environment) GetScheme added in v0.3.0

func (e *Environment) GetScheme() *runtime.Scheme

func (*Environment) InstallCRDs added in v1.0.0

func (e *Environment) InstallCRDs(options envtest.CRDInstallOptions) ([]runtime.Object, error)

func (*Environment) NewManager added in v0.3.0

func (e *Environment) NewManager() (*Manager, error)

func (*Environment) Start added in v0.3.0

func (e *Environment) Start() (err error)

func (*Environment) Stop added in v0.3.0

func (e *Environment) Stop() error

type EventData added in v0.3.0

type EventData struct {
	Type    string
	Reason  string
	Message string
}

type EventWatcher added in v0.3.6

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

func NewEventWatcher added in v0.3.6

func NewEventWatcher() *EventWatcher

func (*EventWatcher) Shutdown added in v0.3.6

func (e *EventWatcher) Shutdown()

func (*EventWatcher) WaitForEventTimeout added in v0.3.6

func (e *EventWatcher) WaitForEventTimeout(expected interface{}, timeout time.Duration) bool

func (*EventWatcher) WatchEvent added in v0.3.6

func (e *EventWatcher) WatchEvent(event *corev1.Event)

type Manager added in v0.3.0

type Manager struct {
	manager.Manager

	EventBroadcaster record.EventBroadcaster
	// contains filtered or unexported fields
}

func NewManager added in v0.3.0

func NewManager() (*Manager, error)

func (*Manager) GetClient added in v0.3.0

func (m *Manager) GetClient() client.Client

func (*Manager) Initialize added in v0.3.0

func (m *Manager) Initialize() (err error)

func (*Manager) Stop added in v0.3.0

func (m *Manager) Stop()

func (*Manager) WaitForEvent added in v0.3.6

func (m *Manager) WaitForEvent(expected interface{}) bool

func (*Manager) WaitForSync added in v0.3.0

func (m *Manager) WaitForSync()

type Recorder added in v0.3.0

type Recorder interface {
	Changes() []Change
}

Jump to

Keyboard shortcuts

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