controllertest

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2023 License: MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertRetry

func AssertRetry(t *testing.T, err error)

Types

type Action

type Action struct {
	Verb                 ActionVerb
	Subresource          string
	GroupVersionResource schema.GroupVersionResource
	Object               runtime.Object
	Name                 string
	Namespace            string
	Visited              bool
}

func (Action) Resource

func (a Action) Resource() string

type ActionVerb

type ActionVerb string
const (
	ActionUpdate ActionVerb = "update"
	ActionCreate ActionVerb = "create"
	ActionDelete ActionVerb = "delete"
)

func (ActionVerb) String

func (a ActionVerb) String() string

type Controller

type Controller interface {
}

type TestRunner

type TestRunner struct {
	Now     time.Time
	Actions []*Action

	Client                    *testingclient.Set
	CoreClient                *k8sfake.Clientset
	ThirdPartyClient          *testingthirdpartyclient.Set
	SharedInformerFactory     *client.InformerFactory
	CoreSharedInformerFactory kubeinformers.SharedInformerFactory
	ThirdPartyInformerFactory *thirdpartyclient.InformerFactory
}

func NewTestRunner

func NewTestRunner() *TestRunner

func (*TestRunner) AssertAction

func (r *TestRunner) AssertAction(t *testing.T, expect Action) bool

func (*TestRunner) AssertCreateAction

func (r *TestRunner) AssertCreateAction(t *testing.T, obj runtime.Object) bool

func (*TestRunner) AssertDeleteAction

func (r *TestRunner) AssertDeleteAction(t *testing.T, obj runtime.Object) bool

func (*TestRunner) AssertNoUnexpectedAction

func (r *TestRunner) AssertNoUnexpectedAction(t *testing.T)

func (*TestRunner) AssertUpdateAction

func (r *TestRunner) AssertUpdateAction(t *testing.T, subresource string, obj runtime.Object) bool

func (*TestRunner) Finalize

func (*TestRunner) Reconcile

func (r *TestRunner) Reconcile(c controllerbase.ControllerBase, target runtime.Object) error

func (*TestRunner) RegisterFixtures

func (r *TestRunner) RegisterFixtures(objs ...runtime.Object)

Jump to

Keyboard shortcuts

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